Guest User

Untitled

a guest
Aug 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from BeautifulSoup import BeautifulSoup
  2. import urllib2
  3. import re
  4. html_page = urllib2.urlopen("http://kteq.in/services")
  5. soup = BeautifulSoup(html_page)
  6. for link in soup.findAll('a'):
  7. result = re.sub(r"httpS+", "", link.get('href'))
  8. print result
  9. print "____________________________________________________"
  10.  
  11. for link in soup.findAll('a'):
  12. print(link.get('href'))
  13. result = re.sub(r"httpS+", "", link.get('href'))
  14.  
  15. for link in soup.findAll('a'):
  16. print(link.get('href'))
  17. if link.get('href')==None:
  18. continue
  19. result = re.sub(r"httpS+", "", link.get('href'))
Add Comment
Please, Sign In to add comment