Jump to content
UBot Underground

Set Table Cell To Csv File


Recommended Posts

Hi folks,

I am trying to scrape 2 columns and set the header names using set table cell then save into seperate columns in csv file.

 

I cannot seem to figure out why my code is not saving the content correclty but it saves it all in 1 column:

 

wait(5)
set(#title,$scrape attribute(<class=w"sinckw-sinck-inner">,"innertext"),"Global")
set(#parag,$scrape attribute(<class=w"sinckwpara-inner">,"innertext"),"Global")
set(#row,"-1","Global")
wait(5)
clear table(&data)
set table cell(&tabledata,0,0,"Title")
set table cell(&tabledata,0,1,"Paragraph")
wait(5)
set table cell(&tabledata,0,0,#title)
set table cell(&tabledata,0,1,#parag)
clear list(%listings)
loop($table total rows(&tabledata)) {
    increment(#row)
    add item to list(%listings,$table cell(&tabledata,#row,0),"Don\'t Delete","Global")
    add item to list(%listings,$table cell(&tabledata,#row,1),"Don\'t Delete","Global")
}
wait(5)
save to file("{$special folder("Application")}\\news-content1.csv",%listings)

 

 

Any assistance would be much appreciated.

 

Thanks

Link to post
Share on other sites

Not sure. Because you do not provide the complete code.
And it is quite confusing

set(#title,$scrape attribute(<class=w"sinckw-sinck-inner">,"innertext"),"Global")
set(#parag,$scrape attribute(<class=w"sinckwpara-inner">,"innertext"),"Global")
clear table(&data)
set table cell(&tabledata,0,0,"Title")
set table cell(&tabledata,0,1,"Paragraph")
set table cell(&tabledata,1,0,#title)
set table cell(&tabledata,1,1,#parag)
clear list(%listings)
set(#row,1,"Global")
loop($subtract($table total rows(&tabledata),1)) {
    add item to list(%listings,$table cell(&tabledata,#row,0),"Don\'t Delete","Global")
    add item to list(%listings,$table cell(&tabledata,#row,1),"Don\'t Delete","Global")
    increment(#row)
}
save to file("{$special folder("Application")}\\news-content1.csv",%listings)
Link to post
Share on other sites

I did have a few Waits in between the set table cell and Onload for Navigate.

 

Th table comes out in the correct format in the debugger but in the speadsheet its in 1 column

Link to post
Share on other sites

I did have a few Waits in between the set table cell and Onload for Navigate.

 

Th table comes out in the correct format in the debugger but in the speadsheet its in 1 column

 

I still do not understand what you are doing.

try.

set(#title,$scrape attribute(<class=w"sinckw-sinck-inner">,"innertext"),"Global")
set(#parag,$scrape attribute(<class=w"sinckwpara-inner">,"innertext"),"Global")
clear table(&data)
set table cell(&tabledata,0,0,"Title")
set table cell(&tabledata,0,1,"Paragraph")
set table cell(&tabledata,1,0,#title)
set table cell(&tabledata,1,1,#parag)
save to file("{$special folder("Application")}\\news-content1.csv",&tabledata)
Link to post
Share on other sites

Thanks Pash,

But the idea is that Title shpuld populate Column 1 and Paragraph Column 2 which is seen in the debug but not inthe csv fil. In the csv file both title and paragraph are in column 1.

set(#row,"-1","Global")

was supposed to represent zero based indexing to compensate for row 0.

Link to post
Share on other sites
  • 7 months later...
 know someone who can help me , I do not think it's so hard to help ....  :mellow:


as is done to select the column and row to save the data ?

 


   A                                               B                              C                                      D

1  MAIL                                 PASSWORD           RECOVERY MAIL              PHONE NUMBER

2 UYH@HOTMAIL.COM      RFVHJIBRVFUI    UYH@MAILNESIA.COM      1141651919581  

3 EDYH@HOTMAIL.COM    EIVU89FHNRFU  EDYH@MAILNESIA.COM     1654981496158


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...