huylinhn 0 Posted November 26, 2016 Report Share Posted November 26, 2016 Hello, I have some difficulties with Threadspawn, what i did is: 1. Use the threadspawn to open new browsers2. Each browser will scrape data on each url3. After scraping it will add to list or table then save to file In brief below, the code does not work, i really need help! add list to list(%links,$list from file("C:\\Users\\NGUYEN HUY LINH\\Desktop\\tuoitre-urls.txt"),"Delete","Global")set list position(%links,0)thread spawn($list total(%links),3) { in new browser { navigate($next list item(%links),"Wait") wait(3) set(#title,$scrape attribute(<id="object_id">,"innertext"),"Local") add item to list(%abc,#title,"Don\'t Delete","Global") wait(3) }} Quote Link to post Share on other sites
pash 504 Posted November 26, 2016 Report Share Posted November 26, 2016 try ui open file("File",#File) clear list(%links) clear list(%abc) add list to list(%links,$list from file(#File),"Delete","Global") set list position(%links,0) thread spawn($list total(%links),3) { in new browser { navigate($next list item(%links),"Wait") wait for browser event("Everything Loaded","") wait(3) set(#title,$title,"Local") add item to list(%abc,#title,"Don\'t Delete","Global") } wait(0.1) } save to file("{$special folder("Desktop")}\\Test.txt",%abc) Quote Link to post Share on other sites
huylinhn 0 Posted November 26, 2016 Author Report Share Posted November 26, 2016 Thanks Pad, Thanks Pad, the code work great for add to list, but with table (increment), it miss lot of rows, really dont know why, could you advise? add list to list(%links,$list from file("C:\\Users\\COMPUTER\\Desktop\\links.txt"),"Delete","Global")set list position(%links,0)set(#rownum,0,"Global")thread spawn($list total(%links),3) { in new browser { navigate($next list item(%links),"Wait") wait(3) set(#title,$scrape attribute(<id="object_id">,"innertext"),"Local") set table cell(&import,#rownum,1,#title) wait(1) increment(#rownum) }} Quote Link to post Share on other sites
huylinhn 0 Posted November 26, 2016 Author Report Share Posted November 26, 2016 Or we have to add list to table as row/column? Quote Link to post Share on other sites
pash 504 Posted November 26, 2016 Report Share Posted November 26, 2016 Or we have to add list to table as row/column?read thishttp://wiki.ubotstudio.com/wiki/Add_List_to_Table_As_Columnhttp://wiki.ubotstudio.com/wiki/Add_List_to_Table_As_Row Quote Link to post Share on other sites
huylinhn 0 Posted November 26, 2016 Author Report Share Posted November 26, 2016 Thanks very much, I will add to list then add list to table, 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.