a guest Aug 12th, 2017 53 in 22 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- url = '...'
- comments = 
- html = urlopen(url)
- soup = BeautifulSoup(html, 'html.parser')
- for c in soup.select('p.comText'):
- prev = soup.select('li.prev a')
- url = prev.get('href') if prev else None
- with open('comments.csv', 'w') as f:
- import csv
- wr = csv.writer(f, quoting=csv.QUOTE_ALL, delimiter='\n')
RAW Paste Data