I'm trying to get all a href from a url. The problem is I can't extract the write a href:
<a href="#!DetalleNorma/203906/20190322" title="" data-bind="html: organismo, attr: {href: $root.crearHrefDetalleNorma(idTamite,fechaPublicacion)} ">SECRETARÍA GENERAL</a>
All I can extract is: #!
from bs4 import BeautifulSoup
import urllib.request as urllib2
import re
html_page = urllib2.urlopen('https://www.boletinoficial.gob.ar/')
soup = BeautifulSoup(html_page)
for link in soup.findAll('a'):
print link.get('href')
Here is with the parse. It is not working too:
import requests
from lxml import html
from bs4 import BeautifulSoup
r = requests.get('https://www.boletinoficial.gob.ar/')
soup = BeautifulSoup(r.content, "html.parser")
for td in soup.findAll("div", class_="itemsection"):
for a in td.findAll("a", href=True):
print(a.text)
UserWarning: No parser was explicitly specified,in Python 3.x