Questions tagged [python-requests]
USE ONLY FOR THE PYTHON REQUESTS LIBRARY. Requests is a full-featured Python HTTP library with an easy-to-use, logical API.
21,877
questions
0
votes
1
answer
51
views
Stumped on AWS Lambda event and context function error
I've been trying to develop a trading bot using AWS Lambda, DynamoDB, and Eventbridge. However, I've been running into some weird issues with trying to run the test environment in order to ensure that ...
-1
votes
0
answers
14
views
How can I execute OpenAI's API with changed proxy in a better way?
According to the way which OpenAI officially offered, I can't execute the API because of some geographic reasons. Although I think I have changed the proxies, it still cause error as ...
0
votes
0
answers
13
views
Python - make request with SSL certificate stored in Windows certificate Store
I'm googling second day in a row and still can't get a solution that works for me. I need to make a request using client certificate that is stored in Windows Certificate Store on path "\Personal\...
0
votes
0
answers
14
views
Request to AWS AppSync GraphQl endpoint returns 401 Client Error: Unauthorized for url
I'm trying to use PyCognito (AWS Cognito) to authenticate a user and an attached identity pool authenticated role to give permissions to the user to query an AppSync GraphQL endpoint but I'm getting a ...
-1
votes
0
answers
23
views
Trouble with Python Requests Library: SSL Certificate Verification Error [duplicate]
I'm trying to make an HTTP request using the Python requests library, but I keep encountering an SSL certificate verification error. I'm not sure how to resolve this issue. Can someone help me ...
0
votes
2
answers
71
views
python - get response 200 at first, then 401 when looping through URLs with requests.get()
I'm scraping NHL game data for multiple games - which are all in different URLs - using requests.get(). The code works fine and I can get the data and get response = 200, but when I loop through the ...
0
votes
0
answers
35
views
I can't get data from POST requests
I need to get the data from this request: https://utp.sberbank-ast.ru/TNG/List/PurchaseList
Namely from this post request: https://utp.sberbank-ast.ru/TNG/SearchQuery/PurchaseList
but when I try to ...
0
votes
0
answers
8
views
"Trouble with Python Requests Library: Unable to Authenticate with API"
I'm trying to make API requests using the requests library in Python, but I'm encountering authentication issues. I've followed the documentation and provided the necessary credentials, but I keep ...
0
votes
1
answer
70
views
Custom LLM from API for QA chain in Langchain
Currently, I want to build RAG chatbot for production.
I already had my LLM API and I want to create a custom LLM and then use this in RetrievalQA.from_chain_type function.
I don't know whether ...
-1
votes
0
answers
37
views
Issue with Python's requests library and SSL certificate verification [duplicate]
I am facing a problem with the requests library in Python when making HTTPS requests. It seems to be related to SSL certificate verification. I am using the following code:
`import requests
url = '...
-2
votes
1
answer
57
views
How to get HTML when requesting this website? [closed]
I try to parse the HTML content using the following code:
import requests
from bs4 import BeautifulSoup
url = "https://www.thespruce.com/christmas-village-display-ideas-8407777"
page = ...
0
votes
1
answer
20
views
NPPES NPI Registry API only returns one item instead of many
I have stored a few provider NPIs in a list called provider_npi and I am using the NPPES API to get other information about these NPIs. Currently the list contains three numbers and when I am doing a ...
0
votes
1
answer
29
views
Can't send audio-file with Aiogram3
I am writing an Aiogram bot, that takes the link to audio('https://xxxxxxx.mp3'), and sends to user this audio in format of audio.
import requests
from io import BytesIO
from aiogram import Bot, ...
0
votes
0
answers
22
views
How can we force a post request within a session to use ipv6 address. I am having an ipv6 machine and trying to reach a url which supports ipv6
import requests
s = requests.Session()
url = "sample_ipv6_host.com/path/to/something"
r = s.post(url, data=data)
Firstly, I wanted to know if it is picking up ipv4 or ipv6 with post. I ...
-2
votes
1
answer
55
views
How can I retreive the main body of a question using the StackExchange API? I can only retreive the title of a question
import requests, openai
# Set your Stack Exchange API key
stack_exchange_api_key = 'your_stack_exchange_api_key'
# Set your OpenAI API key
openai.api_key = 'your_openai_api_key'
# Step 1: Retrieve ...
0
votes
0
answers
20
views
Issue with Python Requests Library - SSL Error
I'm currently working on a Python project where I'm using the requests library to make HTTP requests. However, I'm encountering an SSL error when trying to connect to a specific API endpoint. Here's ...
0
votes
1
answer
27
views
How to upload video to wordpress using request post?
Tried million of things and only works from Postman and not from Python, any help?
I tried sending the video using BytesIO buffer and it said the media isn't supported and tried using open(file) and ...
-1
votes
1
answer
44
views
Python requests.json keeps giving errors
I'm trying to get the current location of International Space Station(ISS) and display it in a json format.
The code seems okay but I keep getting error and I don't know why.
import requests
sample = ...
-1
votes
0
answers
66
views
requests Python library import error on macos [duplicate]
elmanaliyev@Elmans-MacBook-Pro spotify api tutorial % /usr/bin/env /usr/local/bin/python3 /Users/elmanaliyev/.vscode/extensions/ms-python.pyt
hon-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../.....
-2
votes
0
answers
13
views
Python Codes on Windows Server "Only one usage of each socket address is normally permitted" [closed]
im running a Netcup Server where I host multiple Python Codes/Programms that request every 5 second. Recently I saw that I got a lot of "Only one usage of each socket address is normally ...
0
votes
0
answers
37
views
I can't replicate POST request from browser to POST method of Python request
i'm trying to post a form usign python requests.
My script run a selenium chrome driver to log in into a website.
Then I get from selenium driver the cookies and credentials to make others requests ...
0
votes
1
answer
50
views
Error 400: Bad Request with requests.get() but same link working in Google Chrome
I’m trying to get product data from Amazon link:
https://sellercentral.amazon.com/rcpublic/getprograms?countryCode=US&asin=B00T85IQOA&locale=en-US
On any browser that link gives back html ...
-4
votes
0
answers
26
views
Is it possible to make a server (linux) and client (windows) connect to each other using the requests module? [closed]
So, just as the title says, I want to make a windows client that connects to a linux server using the requests module. I would want it to be able to communicate back and forth between one another. I ...
0
votes
1
answer
33
views
How to fetch a random word of a specific category in Python using the requests module?
I am working on a Python project in which I need to fetch a random word from an API such as Heroku, but only of a specific category, for example "Fruits", or "Colors". I was able ...
1
vote
1
answer
51
views
Trouble with Python's requests module - Getting 'ConnectionError'
I'm currently working on a Python project where I'm using the requests module to make API calls. However, I keep encountering a 'ConnectionError' when trying to send a request. I've checked my ...
-4
votes
0
answers
28
views
Issue with Python Requests Library - Unable to Make POST Request [closed]
I'm facing a problem with the Python Requests library while trying to make a POST request. Here's my code:
import requests
url = 'https://example.com/api'
data = {'key1': 'value1', 'key2': 'value2'}
...
0
votes
1
answer
44
views
How to use proxies with seleniumbase?
I am trying to use a proxy with seleniumbase but i get:
You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer.(at the starting chrome page)
(...
-1
votes
1
answer
32
views
How to extract data from Amazon [closed]
I want to extract comments of product from Amazon. But even if I get response 200, I can't reach the data.
Here is what I tried.
base_url = 'https://www.amazon.com/Blink-Doorbell-security-Two-year-...
-1
votes
1
answer
21
views
how to play a audio from a audio stream url using python (don't want to use vlc)
I have a audio url, It can be simply played from a browser and python-vlc library but I want another way to play the audio using requests and libs like pydub, playsound etc,..
I don't use python-vlc ...
0
votes
0
answers
45
views
Query windows authenticated REST API from Azure DataBricks
We have a python notebook running on Azure Databricks which needs to query a REST API hosted on IIS on an on-prem windows server and requires windows authentication.
We've tried the below code from ...
0
votes
0
answers
25
views
Send async generator using Python requests module
I'm using requests module in Python and I want to send data in request streaming way. so I applied chunked-encoded request according to this document.
However, the data to send is provided with ...
0
votes
0
answers
14
views
'BAD_REQUEST' [10004] when access private/user-balance of Crypto.com Exchange API v2
I've been working with the Crypto.com API in Python to fetch data from my portfolio. My script successfully retrieves order history, but fails when trying to access the user balance, returning a '...
0
votes
0
answers
37
views
Python request.get() is not following redirects
I am trying to use the spotify api which uses OAuth. Once you have been authorized, accessing the authorization url redirects you to your specified redirect_uri with a code in the URL parameters. When ...
0
votes
0
answers
18
views
Financial Modelling Prep API calls for stock_news/press_releases
I'm trying to use FMP's stock data API to generate a general overview on stock information and data. The problem I'm encountering is for stock_news or press_releases aspect of the API I'm getting ...
-1
votes
0
answers
19
views
Missing content returned from API via Python requests
When I make a request to an api from the local area, the length of the full data is 5000 and the content is complete, but when I send it from the server, the length is 902 and the data is not complete....
0
votes
0
answers
18
views
Graphql requests returning 429, but working fine when using http.client or when running curl in terminal
Using below requests returns 429 status code, but when same request is used in curl, and by using Python http.client library, i get 200 status code and data.
What can be issue where requests gives 429 ...
2
votes
1
answer
78
views
How to extract text from HTML with BeautifulSoup?
from bs4 import BeautifulSoup
import requests
website = 'https://www.klavkarr.com/data-trouble-code-obd2.php?dtc=p0000-p0299#dtc'
result = requests.get(website)
content = result.text
soup = ...
1
vote
1
answer
31
views
Python dowloading data and "post" url after cURL is returning 400 error
New to Python
trying to extract the shorted time series on a stock (PLS) here:
https://www.halo-technologies.com/markets/shares/asx/PLS
Here is the code, and as you can see the url is POST and not get,...
0
votes
0
answers
34
views
How do I get a specific value from a nested object in Python? [duplicate]
Json response returned is
{
'uniqueReference': 'UV2T495QCP',
'terminal': '0000001',
'operator': 'Python',
'order': {
'orderId': 'TEST',
'currency': 'GBP',
'...
0
votes
0
answers
38
views
python bypass 403 Client Error: Forbidden for url on AWS server (works locally)
[ISSUE]
I am trying to python request a link that has no issues from my PC, but fails when it's running on AWS. Any chance to bypass that ? I guess it is due to some kind of blacklist ? I checked the ...
-2
votes
2
answers
54
views
Python (Requests) getting KeyError 'historical'
import requests
import pandas as pd
import matplotlib.pyplot as plt
def stockpriceanalysis(stock):
stockprices = requests.get(f"https://financialmodelingprep.com/api/v3/historical-price-full/...
0
votes
0
answers
53
views
Unsupported Media Type Did not attempt to load JSON data because the request Content-Type was not 'application/json'
Yes, I know I've seen a lot of different answers to this question, but either I was looking badly, or it just wasn't for my situation.
So
My script in html:
fetch('/AddPosition', {
method: ...
0
votes
0
answers
10
views
Issue with Python requests module - getting 'ConnectionError' [closed]
'I am trying to make a simple HTTP request using the Python requests module, but I keep getting a ConnectionError. I have checked my internet connection, and it seems fine.
Network Verification ...
1
vote
0
answers
26
views
How to click a button and get the result?
I have a problem while crawling the website https://www.sciencedirect.com/journal/journal-of-econometrics/issues. I would have to click a button to let the console to show more information. The ...
-1
votes
0
answers
43
views
While converting scraped data into csv file hotel price and other things showing in special word [closed]
import pandas as pd
import requests
from bs4 import BeautifulSoup
Hotel = []
Description = []
Prices = []
for page_number in range(1, 16):
url = f"https://www.airbnb.co.in/s/Jaipur--India/...
-1
votes
0
answers
32
views
How to make a simple general proxy in python?
I own an ip and port from a hosting service and it lets me upload python files, how to code it to make it so that it acts like a proxy
import requests
proxies = {
"http": "http://...
1
vote
2
answers
49
views
Outputting the API response to Python console
I use an API from Technic company for my project. I need to make a request and get a response and display it in Python console. I wrote the code but it doesn't work. How I can fix it?
import requests
...
1
vote
1
answer
33
views
Scraping Data From Website Using Selenium/Requests/Pandas
I am trying to scrape the table on this website (https://www.cmegroup.com/markets/fx/g10/canadian-dollar.settlements.html). I tried using the requests library, pandas, and selenium, but to no avail. ...
0
votes
2
answers
46
views
Basic webscraping-but I cannot solve this problem
I want to practice webscrapping and follow some video. That video said that:
import requests
from bs4 import BeautifulSoup
url = "https://comic.naver.com/webtoon/list?titleId=811721&tab=wed&...
0
votes
0
answers
18
views
response.text only gets 200 OK
Why am I just seeing 200 OK, I am not looking at the status?
This will send a dns lookup to my dns server to get an A Record back, i.e. ip address.
import requests
import json
requests.packages....