Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- html = '<title>stackoverflow</title><a href="https://stackoverflow.com">test</a>'
- soup = BeautifulSoup(html)
- ext_link = soup.find('a',href=re.compile("^https?:",re.IGNORECASE))
- title = soup.title
- dist = abs_distance_between_tags(ext_link,title)
- print dist
- 30
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement