So I am trying to scrape an html using BeautifulSoup, but I am having problems finding a tag id using Python 3.4. I know what the tag
("tr") is, but the id is constantly changing and I would like to save the id when it changes. For example:
<div class = "thisclass" <table id = "thistable"> <tbody> <tr id="what i want"> <td class = "someinfo"> <tbody> <table> <div>
I can find the
div tag and the
table, and I know the
tr tag is there, but I want to extract the
text next to
id, without knowing what the
text is going to say.
so far I have this code:
soup = BeautifulSoup(url.read()) divTag = soup.find_all("table",id ="thistable") i = 0 for i in divTag: trtag = soup.find("tr", id) print(trtag) i = i+1
if anyone could help me solve this problem I would appreciate it.