Jump to content
UBot Underground

Identify What is Chosen?


Recommended Posts

I am having some really funky results with the chosen system. I am trying to scrape a table but my choose by attribute seems to be failing. Is there anyway to see what is being "chosen"?

 

This is a silly simple thing I am trying to scrape, but it is acting extremely weird. I am using choose by attribute to find a table element using innerhtml "<td nowrap="">Sales</td>" exact. I then use chose ancestor ( also tried chose parent, chose parent, choose parent when using innertext "Sales") and the first chose command fails, "unable to chose nodes".

 

I've dumped the page via save to file $document text right after logging into the site, and confirmed the table is there clear as day. I've used this same code in another bot and it worked perfectly fine. I've even tried chose sibling to iterate through each table cell one by one. It just will not chose anything from this table and I am 100% sure my search strings are right.

 

Link to post
Share on other sites

Yes.

 

Create a variable and then set it to scrape outertext. Like this.

 

http://screencast.com/t/kfukkgYZk4k0

 

Thanks, I get "unable to set variable" when it gets to the set command.

 

This is one of my affiliate accounts and I can't give a login, but I am trying to get a demo account created so someone can look at it. It is very weird though, this should be brain dead simple but it is not working. I've done this same thing in a few other bots and haven't had trouble. In fact I used the exact same code and successfully looped a scrape table without any problems.

Link to post
Share on other sites

You may have a duplicate attribute that you are trying to choose. Go for the actual text itself and then issue a choose by Parent node and do the same test I showed.

 

I did a search in the doc.txt file I saved (output of save to file -> $document text) and the text only appears once. And when I find by the text I am using in the chosen field, it finds it no problem.

 

I changed it to a chose by attribute -> innertext -> Conversion Rate: then chose ancestor and it is now working!

Yet last night I tried searching by text and was having no luck then, but really wanted to use innerhtml as it seems it was the proper way and would be more bulletproof if the text shows up elsewhere on the page. Most of the cell text shows up multiple times on the page but "Conversion Rate:" is unique.

 

But using innertext or innerhtml <TD noWrap>Sales</TD>

 

This is what the table looks like:

 

<TABLE border=0 width="98%">

<TBODY>

<TR>

<TD noWrap>Sales</TD>

<TD noWrap align=right><SPAN id=quick_stats_sales>$ 590.95</SPAN></TD></TR>

<TR>

<TD noWrap>Commissions</TD>

<TD noWrap align=right><SPAN id=quick_stats_commissions>$ 260.98</SPAN></TD></TR>

<TR>

<TD noWrap>Impressions</TD>

<TD noWrap align=right><SPAN id=quick_stats_impressions>580</SPAN></TD></TR>

<TR>

<TD noWrap>Clicks</TD>

<TD noWrap align=right><SPAN id=quick_stats_clicks>42</SPAN></TD></TR>

<TR>

<TD noWrap>CTR</TD>

<TD noWrap align=right><SPAN id=quick_stats_ctr>5.00%</SPAN></TD></TR>

<TR>

<TD noWrap>Orders</TD>

<TD noWrap align=right><SPAN id=quick_stats_orders>10</SPAN></TD></TR>

<TR>

<TD noWrap>AOV</TD>

<TD noWrap align=right><SPAN id=quick_stats_aov>$ 590.95</SPAN></TD></TR>

<TR>

<TD noWrap>Conversion Rate:</TD>

<TD noWrap align=right><SPAN id=quick_stats_cr>4.76%</SPAN></TD></TR>

<TR>

<TD colSpan=2><SPAN id=quick_stats_error_msg> </SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>* Quick Stats will only display data for a single period of time. The most updated data is from yesterday. For detailed statistics, please use the Reporting tools. </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TABLE>

Link to post
Share on other sites

Attached is what i was trying to help you with last night which seemed to work in theory.

 

Glad you got it figured out. But can also try choosing by exact text, inner text and the text in that cell, then ancestor

table cells to variable.ubot

Link to post
Share on other sites

Attached is what i was trying to help you with last night which seemed to work in theory.

 

Glad you got it figured out. But can also try choosing by exact text, inner text and the text in that cell, then ancestor

 

I know I tried searching a few times last night for inner text for just the cell text but that wasn't working for me.

This time it worked fine. Not sure what was going on, but using innerHTML is definitely not working.

 

I really appreciate all the messages and helping out last night though.

 

I should have a login today/tomorrow that isn't my personal account ( I set up a dummy one) and when I do I will post it maybe figure out why it isn't working for me or what I am doing wrong.

 

Thanks as well to UbotBuddy, that technique will come in handy for troubleshooting other bots.

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...