I am trying to use BeautifulSoup to get the text in ul under a div in this website: https://www.nccn.org/professionals/physician_gls/recently_updated.aspx
But I only get an empty div. My code was:
page = requests.get("https://www.nccn.org/professionals/physician_gls/recently_updated.aspx")
soup=BeautifulSoup(page.content,"html.parser")
_div=soup.find("div",{"id":"divRecentlyUpdatedList"})
element = [i.text for i in b.find("a") for b in _div.find("ul")]
The results were:
The HTML file screenshot is as follows: div and ul
Also, there is javascript coming right after the div I am trying to get the content from:
I also tried get all li like this:
l = []
for tag in soup.ul.find_all("a", recursive=True):
l.append(tag.text)
But the text I got was not what I want. Is the text under that div hidden by the javascript?
Any help is welcome. Thank you very much in advance.