Skip to content

Instantly share code, notes, and snippets.

@brchiu
Created March 8, 2020 09:18
Show Gist options
  • Save brchiu/55a756f50d61b77142629846cf9738e6 to your computer and use it in GitHub Desktop.
Save brchiu/55a756f50d61b77142629846cf9738e6 to your computer and use it in GitHub Desktop.
#!/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