Run this code:
import urllib3
from bs4 import BeautifulSoup
def getAllDoxyDonkeyPosts(url, links):
http = urllib3.PoolManager()
page = http.request('GET', url)
soup = BeautifulSoup(page.data)
for a in soup.find_all('a'):
try:
url = a['href']
title = a['title']
if (title == "Older Posts"):
print(title, url)
links.append(url)
getAllDoxyDonkeyPosts(url, links)
except:
title = ""
return
blogUrl = "http://doxydonkey.blogspot.in"
links = []
getAllDoxyDonkeyPosts(blogUrl, links)
The expected output should print 'older posts=blahblah' per line. It ends up concatenating it per line.
We likely need to stick a line feed on our output concatenation.
Run this code:
The expected output should print 'older posts=blahblah' per line. It ends up concatenating it per line.
We likely need to stick a line feed on our output concatenation.