You are viewing a single comment's thread from:

RE: Part-1 Web Scraping using MechanicalSoup

in #utopian-io7 years ago (edited)

I just tried your code and it is working, thanks!

I'm trying to tweak it a little bit, to get posts from tag 'new' instead of 'trending' and I can't figure it out, how to do it. Class name seems to be the same. How should I change this line of code:

articles = list(browser.get_current_page().find('ul', class_='PostsList__summaries'))

...to be able to search articles that were newly posted? I tried inspecting the the code but I can't figure out what I need to change:

0020_py_question_for_new_posts.png

Btw, looking forward to part 2 ;-)

Sort:  

Sorry for the late reply @veleje, I totally missed out your comment, since I was a bit busy. I hope you see this.

If you want to get the new posts a simple modification of the code will do it, just change the URL in the code like this:

browser.open('https://steemit.com/created')

Since all the new posts are listed in the URL : https://steemit.com/created

Hope that helps.
I am currently in the work of Part 2.
Once again sorry for the late reply.

Thank you