Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. html = '<title>stackoverflow</title><a href="https://stackoverflow.com">test</a>'
  2. soup = BeautifulSoup(html)
  3. ext_link = soup.find('a',href=re.compile("^https?:",re.IGNORECASE))
  4. title = soup.title
  5. dist = abs_distance_between_tags(ext_link,title)
  6. print dist
  7. 30
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement