This question already has answers here: How can I parse (read) and use JSON? (5 answers) Closed 24 days ago. 1/ I get my data with this code and then im trying to extract the value of the attribute “sku”: 2/ this is the data that i get. my goal is to extract the value of the attribute “sku” but
Tag: python-requests
Download PDF from PeerJ
I am trying to use Python requests to download a PDF from PeerJ. For example, https://peerj.com/articles/1.pdf. My code is simply: However, the Response object returned displays as <Response [432]>, which indicates an HTTP 432 error. As far as I know, that error code is not assigned. When I examine r.text or r.content, there is some HTML which says that it’s
Error ‘Unexpected HTTP code on the target page’, ‘status_code’: 403 when I try to request a json url with a proxy api
I’m trying to scrap this website https://triller.co/ , so I want to get information from profile pages like this https://triller.co/@warnermusicarg , what I do is trying to request the json url that contains the information, in this case it’s https://social.triller.co/v1.5/api/users/by_username/warnermusicarg When I use requests.get() it works normally and I can retrieve all the information. The problem arises when I try
How to send raw data in a POST request Python
Body I’m trying to send: This is my code right now: If I run this in Postman though it works just fine: Postman screenshot Answer you can geenrate the code form postman itself
Verification for successful or failed login?
I would like to check if after the request I successfully connected to the site or not. I tried several methods that I know but nothing works. Can someone help me please? Answer If you logged in successfully server side will respond Set-Cookie header with authentication token. Let’s suppose that success header looks like: In this case your code should
How to correctly make Create DM request in Discord API?
I am trying to create dm This code receives response with “400: Bad request” message. I’ve read this but I can’t find any examples of correct usage of this request. Answer I finally understood my mistake, I shouldn’t pass dictionary as data but should pass a str, so I changed data=data to data=json.dumps(data) and it worked
PEM Certificate & TLS Verification against REST api
I have been provided with a pem certificate to authenticate with a third party. Authenticating using certificates is a new concept for me. Inside are two certificates and a private key. The issuer has advised they do not support SSL verification but use TLS(1.1/1.2). I have run a script as below: I’m getting the following error: SSLError: HTTPSConnectionPool(host=’url.com, port=443): Max
Unable to fetch tabular content from a site using requests
I’m trying to fetch tabular content from a webpage using the requests module. After navigating to that webpage, when I manually type 0466425389 right next to Company number and hit the search button, the table is produced accordingly. However, when I mimic the same using requests, I get the following response. I’ve tried with: How can I fetch tabular content
How to parse Google custom search javascript output in python?
I am trying to fetch some articles from ACL website based on the keywords as input. The website is using google custom search API and the output of the API is a javascript object. How I can parse the returned object in python and fetch the article name, URL, and abstract of the research paper from the object. The script
is there a way to manipulate image without saving to a file first?
I’m trying to collect img data for my ML/DL project. I need facial data so, I have to detect the face and crop around it. I have a bunch of img URLs that I searched online. Normally I would save them in a file using requests library, but would it be possible to do it in-memory? I looked at some