Created
March 8, 2020 09:18
-
-
Save brchiu/55a756f50d61b77142629846cf9738e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from lxml import html | |
import requests | |
r = requests.get('http://www.protocol5.com/Fibonacci/60.htm') | |
tree = html.fromstring(r.content.decode('utf8')) | |
li_elms = tree.xpath("//*[contains(@class, 'number-result')]/li") | |
for li in li_elms: | |
print(li.xpath('h4/text()')) | |
print(li.xpath('div/text()')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment