xpath_test.py 172 B

123456
  1. from requests_html import HTML
  2. doc = open('dy.html').read()
  3. html = HTML(html=doc)
  4. links = html.find('div[data-e2e="user-detail"] a', first=True).attrs['href']
  5. print(links)