I'm not quite sure what you're asking. This code results in all the tables on the page:
And this code results in all the links in table 2:
soup.fetch("table")[2].fetch("a") Similarly, this code gets all the "td" tags in table 2:
soup.fetch("table")[2].fetch("td") It might help to give you a quick run-through of object syntax. Take this following code:
This code refers to the "colour" property of the "chair" object.
This code calls the "chopup" method that belongs to the chair object. Thus, you can think of "." as meaning "belongs to". The "colour" property belongs to the chair object, as too does the "chopup" method. In programming lingo, they are
members of the chair object.
Lets go back to BeautifulSoup:
links = soup.fetch("tables")[3].fetch("a") It may be more obvious what this does if I expand it out a little:
all_tables = soup.fetch("tables")
table3 = all_tables[3]
links_in_table3 = table3.fetch("a")