Created
August 18, 2018 14:27
-
-
Save gileno/26fc4d5077c24395afc706f7916e06fc to your computer and use it in GitHub Desktop.
This file contains 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
import urllib.request | |
import re | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/5’ | |
} | |
req = urllib.request.Request(url, headers=headers) | |
with urllib.request.urlopen(r) as response: | |
html = response.read().decode(‘utf-8’) | |
preco = re.findall(r'<input type="hidden" value="(.*)" id="taxa-comercial">', html)[0] | |
print(preco) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment