Hi, I wrote a small script as below
The url that we are supposed to use via a browser is https://www.nseindia.com/option-chain. What I am trying to do is to read the json file with the values that the table in this page gets populated with.
This used to work and I was able to get the json file. But it seems to have stopped working and instead of an html page with the json, I am getting a message "Resource Not found"
If I copy the url from the Network tab via Inspect into a browser window, it displays the jason content. But if I put this url into my scipt, it gives the "Resource Not found" message.
Can you please help? Thank you
from selenium import webdriver from selenium.webdriver.chrome.options import Options from bs4 import BeautifulSoup options = Options() browser = webdriver.Chrome(executable_path=r"C:\Users\Admin\Downloads\chromedriver_win32\chromedriver.exe",options=options) url = "https://www.nseindia.com/api/option-chain-equities?symbol=ACC" browser.get(url) soup = BeautifulSoup(browser.page_source,'lxml') print(soup.prettify())I got the url with query string (https://www.nseindia.com/api/option-chai...symbol=ACC) after doing Inspect and looking up the Network tab in developer tools.
The url that we are supposed to use via a browser is https://www.nseindia.com/option-chain. What I am trying to do is to read the json file with the values that the table in this page gets populated with.
This used to work and I was able to get the json file. But it seems to have stopped working and instead of an html page with the json, I am getting a message "Resource Not found"
If I copy the url from the Network tab via Inspect into a browser window, it displays the jason content. But if I put this url into my scipt, it gives the "Resource Not found" message.
Can you please help? Thank you