request

How can I fix invaild format specifier in python?

How can I fix invaild format specifier in python? Question: I can’t find what I am doing wrong… I am trying to send a post req with custom values but cant seem to make it work always getting invaild format specifier. Here is the original request: headers = header data = { ‘source’: ‘src_1MnugIHWW88ELdDvkI8CNwa1’, ‘final_cres’: …

Total answers: 1

Flask Mutating Request Path

Flask Mutating Request Path Question: Problem Statement When path contains %25, flask seems to be mutating the incoming path to treat %25 as % instead of preserving the original request path. Here are the request and path variable: Request: : GET http://localhost:5000/Files/dir %a/test %25a.txt Flask request.base_url: http://localhost:5000/Files/dir%20%25a/test%20%25a.txt Debug: 127.0.0.1 – – [14/Feb/2023 12:00:49] "GET /Files/dir%20%a/test%20%25a.txt …

Total answers: 1

project ID printed for every task on the API problem

project ID printed for every task on the API problem Question: I have this code below, requesting an api. Every ID in listID loops 4 times in the url. So if the listID = [1,2,3,4,5], the url will be : url = "https://xxxxapi/v1/implantacao/projeto/1/tarefa?start=0&limit=50" then url = "https://xxxxapi/v1/implantacao/projeto/1/tarefa?start=1&limit=50" and etc, start goes 0 to 3 for …

Total answers: 2

Extract 10K filings url for a company using CIK number python

Extract 10K filings url for a company using CIK number python Question: I am working on a project to find the latest 10K filings url for a company using CIK number. Please find the code below: import requests from bs4 import BeautifulSoup # CIK number for Apple is 0001166559 cik_number = "0001166559" url = f"https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK={cik_number}&type=10-K&dateb=&owner=exclude&count=40" …

Total answers: 1

Python Request URL response to slow, how make more quickle?

Python Request URL response to slow, how make more quickle? Question: I have this code in python: session = requests.Session() for i in range(0, len(df_1)): page = session.head(df_1[‘listing_url’].loc[i], allow_redirects=False, stream=True) if page.status_code == 200: df_1[‘condition’][i] = ‘active’ else: df_1[‘condition’][i] = ‘false’ df_1 is my data frame and the column "listing_url" have more than 500 lines. …

Total answers: 1

Python request to retrieve all requests from Postman collection

Python request to retrieve all requests from Postman collection Question: I need to print all requests from specific Postman collection. I have this code: import requests # Set up Postman API endpoint and authorization postman_api_endpoint = "https://api.getpostman.com/collections" postman_api_key = "PMAK-63b6bf724ebf902ad13d4bf2-e683c12d426716552861acda**********" headers = {"X-Api-Key": postman_api_key} # Get all requests from Postman collection collection_id = "25184041-c1537769-f598-4c0e-b8ae-8cd185a79c03" response …

Total answers: 1

Multithreading in the program does not work for me, what could be the problem?

Multithreading in the program does not work for me, what could be the problem? Question: I’m trying to make my account autoregister on 1 of the servicers using python. I decided to resort to multithreading. I enter the number of threads I need into the console, but they do not start asynchronously. At first, the …

Total answers: 1

Python list index out of range in for loop

Python list index out of range in for loop Question: With the aviationstack API, I try to get info about every flight departing from Marseille (France) airport. I use the first steps to determine how many pages I have to iterate, as the API returns the total number of results and documentation says the default …

Total answers: 1

I am trying to dowload a csv in python but all i get is weird symbols

I am trying to dowload a csv in python but all i get is weird symbols Question: I am trying to download this csv in this link when i download with the browser it’s ok but the code I can’t https://www.policyuncertainty.com/media/Global_Policy_Uncertainty_Data.csv I have tried using pandas with utf-8 and latin-1: If I do it without …

Total answers: 1