I need an application that can scrape ads from Facebook's newsfeed. It should allow the user to login to Facebook and then go to the index page (where the newsfeed is shown). It should then start scrolling down, scanning the page for ads. These have the word 'sponsored' right below the title. When it spots one, it should make a screenshot of this ad. The filename of the screenshot should be the name of the page that is advertising on Facebook (the words in the ad title, right above 'sponsored'). It's best to append an ID to this filename, so that ads by the same advertiser don't get overwritten.
The next step is to click the ad and make a full page screenshot of the landing page. The filename can be the same as the screenshot of the ad, but with "-landing_page" appended.
Finally, it takes the URL of the landing page and appends it to a text file, together with the filename of the screenshot.
Other than username and password for Facebook, the user should also be able to specify the...