Skip to content
Advertisement

Tag: python-requests

How to iterate in each element?

We need to take the stocks with BeautifulSoup. Code only iterates the first element. How to iterate each one? Answer First find all ul elements and iterate over it to find title and values according to class wise and append items to dict1 with key title Now you can use pandas module to transform data to DataFrame using pd.DataFrame method

Python program that tells you whether or not you need an umbrella when you leave the house [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago. Improve this question The program should: Ask you if it is raining using input() If the input is ‘y’, it should output ‘Take

Stream OpenCV Video Capture to flask server

Greeting, I was working on a drone project, I wanted to take stream from my drone process it on my laptop and give a command based on processing, I was using the flask framework from the same. Currently, as the first step I want to take the stream from drone and PUT it to the flask server and view it

POST request to TRIAS API does not work with requests

I maintain an API client for the TRIAS API (German Link) to retrieve local public transport information for various states / cities in Germany. Recently one of the TRIAS servers (Baden-Württemberg) started responding with an error message to requests. When I try to send the request via curl, the server responds just fine: However, it fails with requests.post(), while it

How to extract all symbol and last_price from this json?

I tried like this, but it doesn’t work. It worked with an other json file (https://www.binance.com/fapi/v1/ticker/price) I think it’s because the beginning and end is different. There is some parts before the bracket and after. I got the error: symbol = (pair[‘symbol’]) TypeError: string indices must be integers Answer e contains some other information. The data that you want is

How do I provide my access_token with python

https://i.stack.imgur.com/Iqrsw.png Is there a way to do this with requests? Answer According to this https://www.mercadopago.com.ar/developers/en/reference/payments/_payments_id/get you need to provide a header with your access token you get through OAUTH. And then once you get the access token, you can do which will return you a json result

How to create multiple API requests based on different param values?

So I have this list which stores different request URLS for finding an account. Each url looks something like this. ‘https://example.somewebsite.ie:000/v12345/accounts/12345/users’ Each URL has a different ID so the next URL in the list would be for example ‘https://example.somewebsite.ie:000/v12345/accounts/54321/users’ I’ve tried doing something like this. This only prints out the last GET requests data. How do I write multiple requests

Python put requests on a CIRCUITPY

I have a CIRCUITPY macro board (keybow 2040) that I want to make automatically download a file, but I don’t have enough storage space on the board to put all the required libraries for the python requests module. The board’s available storage space is 866 KB, which is not nearly enough storage space for all the required modules to use

Advertisement