Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exclude unwanted match-result
#2
(Apr-25-2021, 01:57 PM)jimsxxl Wrote: There are 2 exactly the same blocks of code on Youtube:
Use CCS selector to get exact tag,in browser first inspect right click Copy ➡ Copy ➡ Selector
In BS then you use select() or select_one().
view_count = soup.select_one('#metadata-line > span:nth-child(1)')
print(view_count.text)
Output:
Sett 18k ganger
Reply


Messages In This Thread
Exclude unwanted match-result - by jimsxxl - Apr-25-2021, 01:57 PM
RE: Exclude unwanted match-result - by snippsat - Apr-25-2021, 04:36 PM
RE: Exclude unwanted match-result - by jimsxxl - Apr-25-2021, 05:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to exclude certain links while webscraping basis on keywords Prince_Bhatia 0 3,256 Oct-31-2018, 07:00 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020