Skip to content

Instantly share code, notes, and snippets.

@koraysaritas
Last active October 22, 2017 16:09
Show Gist options
  • Save koraysaritas/21a0e5429a1be2366c41193fba287c5f to your computer and use it in GitHub Desktop.
Save koraysaritas/21a0e5429a1be2366c41193fba287c5f to your computer and use it in GitHub Desktop.
ht
from urllib import parse
from bs4 import BeautifulSoup
elem = '<a title="Sakura Sakura Onsen" href="https://www.google.com/maps?ll=31.8623230000,130.8571860000&amp;spn=0.006130,0.009795&amp;t=k&amp;hl=en">3 BLUE</a>'
# ll
split = parse.urlsplit(elem)
qs = parse.parse_qs(split.query)
ll = qs['ll'][0].split(',')
# 3 BLUE
blue3 = BeautifulSoup(elem, "html.parser").find('a').text
ll.append(blue3)
print(" ".join(ll))
@koraysaritas
Copy link
Author

mkdir hitnet
cd hitnet
python3 -m venv venv
source venv/bin/activate
pip install beautifulsoup4
pip install urllib3
python ht.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment