dsc76 6 Posted July 14, 2011 Report Share Posted July 14, 2011 Hello, I am trying to scrape and then save the content to a different file each time the loop cycles. For example saving different articles in text files like scrape1.txt, scrape2.txt, scrape3.txt etc. I receive the error “Unable to save to file†with attached a screen shot. I also tried http://support.ubotstudio.com/index.php?/Knowledgebase/Article/View/44/10/ubot-studio-creating-files-as-the-script-runs with no luck. Any help is appreciated.Thanks! Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 14, 2011 Report Share Posted July 14, 2011 In your "save to file" try to remove the $list item in the content area and replace with the $list only. Like this Quote Link to post Share on other sites
dsc76 6 Posted July 14, 2011 Author Report Share Posted July 14, 2011 I still get the same error “Unable to save to file†Any other suggestions? Thanks. Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 14, 2011 Report Share Posted July 14, 2011 try to remove the $list item and just set a variable outside the loop and put a 0 value on it. At the end of the loop put a "inc" in that variable. Put that variable inside your save file replacing the $list item. If still doesn't help you can upload the source or pm it to me and I will edit it for you. Quote Link to post Share on other sites
dsc76 6 Posted July 14, 2011 Author Report Share Posted July 14, 2011 I tried to implement as you suggested but not sure if I did it correctly. Now I do not receive the error as before but there are no files being created. I am really stumped with this. I uploaded the relevant code for you to review. Thanks for the help! test123.ubot Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 14, 2011 Report Share Posted July 14, 2011 I tried to implement as you suggested but not sure if I did it correctly. Now I do not receive the error as before but there are no files being created. I am really stumped with this. I uploaded the relevant code for you to review. Thanks for the help! test123.ubotHere check this test123.ubot Quote Link to post Share on other sites
dsc76 6 Posted July 14, 2011 Author Report Share Posted July 14, 2011 Ok, almost got it. Now each time the cycle loops and new .txt file is created for each scrape! The issue now is the content ( actual text being scraped) is the Same in each file. I tried adding a "clear list" after the "save file" but then no .txt files were created. Do I need to add "clear list" in another position? Any other suggestions? Thanks a bunch! Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 14, 2011 Report Share Posted July 14, 2011 Try to Insert a clear list at the beginning of the loop. It should clean the list on each cycle. Quote Link to post Share on other sites
dsc76 6 Posted July 14, 2011 Author Report Share Posted July 14, 2011 That worked! Thank you very much!! Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 14, 2011 Report Share Posted July 14, 2011 No problem. 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.