Jan-11-2017, 01:28 PM
(This post was last modified: Jan-11-2017, 01:28 PM by edithegodfather.)
hey, thanks for the reply, sorry i couldn't get back to you sooner, i started work again and i don't have that much time on my hands anymore.
also sorry about the code tag thing, i kept noticing it was being formatted but i thought it was just doing itself; i'll be sure to put it in there on further replies. :)
i'm also getting some errors on this code right now and i'm trying to figure out how to make it work.
[edit]
ok, i figured it out; i made a new variable where i used the replace function
also sorry about the code tag thing, i kept noticing it was being formatted but i thought it was just doing itself; i'll be sure to put it in there on further replies. :)
i'm also getting some errors on this code right now and i'm trying to figure out how to make it work.
[edit]
ok, i figured it out; i made a new variable where i used the replace function
def crawler(max_pages): page = 1 while page <= max_pages: url = 'http://www.publi24.ro/anunturi/imobiliare/bucuresti/?pag=' + str(page) source_code = requests.get(url) plain_text = source_code.text soup = BeautifulSoup(plain_text, 'html.parser') for link in soup.findAll('a', {'itemprop':'name'}): href = 'http://www.publi24.ro' + link.get('href') href2 = href.replace('http://www.publi24.rohttp://www.publi24.ro','http://www.publi24.ro') # ad_title(href) # views(href) print(href2) page += 1