Shannon 0 Posted July 12, 2012 Report Share Posted July 12, 2012 I am using the scrape attribute file to scrape information from a website and save it to a list However, the issue I am running into is the scraped data is populating the list as one item. So, when I try to call the information using the next item function it is populating the field with all of the items scraped from the previous scraped attribute function as just 1 item. So if there are 7 items scraped instead of the script seeing it as 7 items it is seeing all 7 as 1 item. How do I get the items that are scraped to appear as separate items and not just one single item. For instance, this is what the debugger looks like… %scraped: 1 items info1info2info3info4info5info6info7 When I save the scraped list to a file the items appear on a new line. so my guess would be that the program should read each item as a separate item. However, it is reading all of the items as one item. I have also tried saving the list to a file and then calling that file using the add list to list function and I am running into the same issue. Hopefully my description of this make sense :-) Quote Link to post Share on other sites
JohnB 255 Posted July 12, 2012 Report Share Posted July 12, 2012 Use add list to list, not add item to list. John 1 Quote Link to post Share on other sites
merkaba 36 Posted July 12, 2012 Report Share Posted July 12, 2012 I had the same problem, it's holding all the data as 1 item. The solution I use : define save_Add_delete { save to file("{$special folder("Application")}/list.txt", %list_name) comment("Saves list to application Folder") add list to list(%new_list, $list from file("{$special folder("Application")}/list.txt"), "Delete", "Global") comment("Adds to a new list, this time each line is a list item.") delete file("{$special folder("Application")}/list.txt") comment("Deletes the transition file, you don\'t need it, but sometimes its worth doing") } A quick trip into ubot, this works also and is a lot less time add list to list(%list_to_add_to, $page scrape("what to scrape left side", "right side"), "Delete", "Global") 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.