+ 2
How to acces html link using python
I want to access html link through my code
2 Answers
+ 2
i don't dive deep enough into python, but i hope this can help you:
Try withBeautifulsoup:
from BeautifulSoup
import BeautifulSoup
import urllib2
import re
html_page = urllib2.urlopen("http://www.yourwebsite.com")soup =BeautifulSoup(html_page)
for link in soup.findAll('a'):
print link.get('href')
In case you just want links starting with http://, you should use:
soup.findAll('a', attrs={'href': re.compile("^http://")})
+ 1
Okie thanks for Info....will try it