Skip to content Skip to sidebar Skip to footer

Find Or Select Elements From Python To Scrape With Beautifulsoup

I am not sure how to select below items inside the table class='table-info' Using python and beautifulsoup, I want to extract the: phone email website main activity (li element

Solution 1:

Have you considered using css selectors that count the table's children? If your table will always mirror the example code, it just might be easier to use the nth-child property.

  • Phone: tr:nth-child(10) .col-2-text
  • Email: tr:nth-child(11) a
  • Website: span
  • Main Activity: li

I used Selector Gadget to grab these tags. You might want to run it on your page directly to see if there are any other ones that are easier to implement.

Post a Comment for "Find Or Select Elements From Python To Scrape With Beautifulsoup"