0

I am trying to scrape data from this website: http://nepalstock.com/indices . I am not being able to scrape table data after changing value of 'Select Indices or Sub Indices' https://i.stack.imgur.com/J0WMn.png

Since the url does not change, I do not know how to proceed on this.

So far, this is my code:

import requests
import pandas
from bs4 import BeautifulSoup
html=requests.get("http://nepalstock.com/indices")
soup=BeautifulSoup(html.content,"html.parser")
lst=[]
for row in soup.find_all("tr"):
    l=[]
    for td in row.find_all("td"):
        l.append(td.get_text())
    lst.append(l)
df=pandas.DataFrame(lst[1:])
df.head()
Dimanjan
  • 563
  • 6
  • 13
  • 2
    Possible duplicate of https://stackoverflow.com/questions/28892543/scraping-a-response-from-a-selected-option-in-dropdown-list – Sandesh Gupta Apr 12 '18 at 08:59
  • 2
    Possible duplicate of [scraping a response from a selected option in dropdown list](https://stackoverflow.com/questions/28892543/scraping-a-response-from-a-selected-option-in-dropdown-list) – Abbas Apr 12 '18 at 09:04

0 Answers0