Why CSS Selector can't find anything?
wcmiracle opened this issue · 0 comments
wcmiracle commented
I want to parsing the comments under this video,
I have get the source code correctly,
But the CSS doesn't parse to anything,
Why?
my code:
import time
from requests_html import HTML
from selenium import webdriver
driver = webdriver.Chrome()
url = 'https://www.bilibili.com/video/BV1yU4y1C7cd'
driver.get(url)
time.sleep(5)
content = driver.page_source
html = HTML(html=content)
com= html.find('div.con > p.text') # can't get
count = len(com)
print(com[0].text)