Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why CSS Selector can't find anything? #519

Closed
wcmiracle opened this issue Aug 16, 2022 · 0 comments
Closed

Why CSS Selector can't find anything? #519

wcmiracle opened this issue Aug 16, 2022 · 0 comments

Comments

@wcmiracle
Copy link

wcmiracle commented Aug 16, 2022

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)

image

@wcmiracle wcmiracle changed the title Why I can't get anything? Why CSS Selector can't find anything? Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant