+ 2

How to acces html link using python

I want to access html link through my code

18th May 2017, 2:04 PM
srinivasareddy yeruva
srinivasareddy yeruva - avatar
2 Réponses
+ 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://")})
18th May 2017, 2:47 PM
Setiawan Next
Setiawan Next - avatar
+ 1
Okie thanks for Info....will try it
18th May 2017, 2:50 PM
srinivasareddy yeruva
srinivasareddy yeruva - avatar
Aujourd'hui en vedette
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes