crawlerApp/test_crawler.py
2022-02-06 02:35:04 +05:00

15 lines
No EOL
430 B
Python

from socket import timeout
from time import sleep
from requests_html import HTMLSession
session = HTMLSession()
headers = {
'user-agent':'Mozilla/5.0',
'x-requested-with': 'XMLHttpRequest'
}
r = session.get('https://hub.docker.com/r/vectorim/element-web/tags',headers=headers,timeout=300)
r.html.render(sleep=1,keep_page=True,scrolldown=1)
tags = r.html.search('data-testid="navToImage"')
print(tags)
print(tags[0].text)