I’m using the requests module from Python to get a webpage that requires login to access. I know how to have requests enter the login details on a page, but I am having trouble accessing the form fields on this particular page because they are generated by Javascript after clicking a button. Here’s the website in question: https://pennmedialab.getconnect2.com/signin.aspx When first
Tag: python-requests
Python requests.get of link, passed in a for, gets always the same content of the first link
I’m trying to make a for loop of links that are opened and from which I then retrieve data; right now I have the problem that at every cycle it always retrieves the same page (the first one) even though I change the link every time. Answer Try to remove idCategory=5&idExpansion=1178 from the filterURL: Prints:
How to convert a requests GET request in Python to asyncio with payloads?
I am trying to parallelize requests to the Wikidata API using Python’s asyncio module. My current synchronous script does the following: I am trying to do the same using asyncio, to send requests asynchronously. From this blogpost and the documentation, I understood that I need something like: However, I did not manage to find how to add these payloads in
Trying to get data from a table using beautifulsoup in python
Trying to get the “all splits” line of numbers from https://insider.espn.com/nba/player/splits/_/id/532/type/nba/year/2003/category/perGame (html code is in the picture) my code returns the ‘all splits’ text instead of the numbers I’m looking for. How do I go about changing the lookups in the GetStats function area to get the numbers instead of the first column descriptors. Answer To get the all_splits stats
An Error while using bs4 and requests in replit
When I use bs4 an requests locally it works but when i put my code In replit :(The Error): The ERROR Please Help Me ! If someone can explain what is the problem with replit . Answer This would be much easier to debug if you included a sample link [a plausible value of URL.format(username)]. The error seems to be
Whatsapp cloud API uploading media get error file type using python
So i’m trying to upload an image to facebook graph API whatsapp media (having a hard time with how they name things) i tried on postman first and successfully get the uploaded media ID, but when i tried this on python with request objects i got error response 400 something like this: … Param file must be a file with
How to scrape table with flight data, avoiding an empty result?
I’m trying to extract a table from a webpage and have tried a number of alternatives, but the table always seems to remain empty. Two of what I thought were the most promising sets of code are attached below. Any means of extracting the data from the webpage would be considered as helpful. I have also included a screenshot of
How can I do a python API request with the body?
if I do a POST request on Postman with my local API server it works: But if I try in python with this syntax it doesn’t work: requests.post(‘http://127.0.0.1:5001/api/v0/add’, data={‘path’: ‘test’}).text it returns: “file argument ‘path’ is requiredn” Can you please explain me why it doesn’t work? Answer The issue is that using data on requests.post defaults to application/x-www-form-urlencoded while your
Can’t get href from Selenium webdriver scraping youtube
I am trying to scrape youtube videos from a channel by doing the following code below however, it seems that my element_titles don’t have a href attribute. This worked about a year ago and I am unsure why it doesn’t work now? Did youtube change the way we can get href? The following attribtues are what is found in the
How do I plot the frequency of an event overtime with pandas?I
I was trying to plot some data from a pandas dataframe. My table contains 10000ish films and for each of them two info: the year it got published, and a rating from 0 to 3. I am having a hard time trying to plot a graph with the pandas library that shows the number of films that received a particular