Feb-15-2020, 04:22 PM
I have a problem in scraping data from website which do not change the URLs when we choose data from ceratin dates with the calendar option given on the website. I have tried opening up the Network option from Developer Tools but that did not help as the new link which it showed had no values in it.
With reference to this thread:
https://stackoverflow.com/questions/5456...5#54616315
Could someone please explain me on how to use this on other website:
https://www.sharesansar.com/today-share-price
This is my code but it only prints the date and not the data:
With reference to this thread:
https://stackoverflow.com/questions/5456...5#54616315
Could someone please explain me on how to use this on other website:
https://www.sharesansar.com/today-share-price
This is my code but it only prints the date and not the data:
from bs4 import BeautifulSoup import requests url = 'https://www.sharesansar.com/today-share-price' dates = ['2020-02-12', '2020-02-13'] for date in dates: req = requests.post(url, {'date' : date}) #Sends data to the server soup = BeautifulSoup(req.content,'lxml') #Response in bytes print(f'\n{date}\n') for article in soup.find_all('table', class_='table table-bordered table-striped table-hover dataTable compact'): data = article.text print(data)