ezhomeprofit 0 Posted October 10, 2014 Report Share Posted October 10, 2014 So I'm trying to create a bot that goes to a webpage, scrapes a certain email address snd saves it to a .txt file. The bot then navigates to another webpage and scrapes another email address and saves it to that same .txt file. It then keeps repeating this process for a set amount of times. I'm able to get it to navigate to the first website on my list and scrape the email address to a .txt file fine. The problem is when it navigates to the second website on the list and scrapes that email address. It scrapes the email like it's supposed to, but instead of adding it to the list with the previous scraped email, it replaces that email address instead. So when I go and open up the .txt file, instead of having both email addresses listed, it only has 1 (the last email address that it scraped). So every time it scrapes an email address, it just replaces the current one. How do I go about getting it to keep adding to the list each time it scrapes an email address, instead of replacing the previous one? Thanks in advance for any help you guys can give me! - Roger Quote Link to post Share on other sites
bestmacros 60 Posted October 10, 2014 Report Share Posted October 10, 2014 use "append to file" command instead of "save to file" Quote Link to post Share on other sites
ezhomeprofit 0 Posted October 10, 2014 Author Report Share Posted October 10, 2014 Awesome! Thanks, I'll give it a try. Quote Link to post Share on other sites
ezhomeprofit 0 Posted October 10, 2014 Author Report Share Posted October 10, 2014 It saved both of them to the list, but it listed the second email address on the same line immediately next to it. Any idea how I'd get them to go one per line? Quote Link to post Share on other sites
bestmacros 60 Posted October 10, 2014 Report Share Posted October 10, 2014 you need to add "$new line" after content to emulate line break Quote Link to post Share on other sites
ezhomeprofit 0 Posted October 10, 2014 Author Report Share Posted October 10, 2014 Thanks so much for your help! You saved me a lot of time. I promise no more questions. lol. Quote Link to post Share on other sites
arunner26 51 Posted October 10, 2014 Report Share Posted October 10, 2014 ezhomeprofit,Another approach that might be more typical is to use "add item to list" and once you have all the emails then use the "save to file" to write them all out one time. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.