Python Forum

Full Version: Find the next item once the previous one has been identified
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Here is the page I explore:
Advanced ASP.NET Core 3 Security

In particular I'm interested in the page's fragment "Product details":

[Image: Screenshot-from-2021-01-13-17-43-17.png]

Here is how I've found first items of "Product details" table (i.e. Publisher, Language, Paperback, etc.)
bbb = soup.find_all(attrs={"id":"detailBullets_feature_div"})
for child in list(bbb[1].children)[1].children:
  if isinstance(child, Tag):
     try:
       print("\n\1st item\t:", child.span.span.next_element.string)
     except:
       print("failed !")
How to find 2nd items in the table (i.e. Apress, English, 425 pages) ?
Thanks.
Do you get anything at all,or do use Selenium(as may be needed here)?
Look at what info can get from Amazon Books API.
Quick test with Requests and BS.
Output:
<body> To discuss automated access to Amazon data please contact [email protected]. ..... <p class="a-last">Sorry, we just need to make sure you're not a robot. For best results, please make sure your browser is accepting cookies.</p>