I'm using the data from one table as my search criteria on a website. Sometimes it comes back with something close but not quite the same. Right now I'm extracting a bunch of Kinds from the resultant search but I'd also like to write the original search criteria in to the extract table. The "Extract to table" function seems to be limited to kinds...is my understanding correct?
thanks!
Extracting Columns from your source table to another table
-
- Posts: 20
- Joined: Thu May 12, 2011 4:05 pm
Re: Extracting Columns from your source table to another tab
You can extract the search query if it's anywhere in the page, even from the search box. To extract the value of a text box just create a kind that selects it, and a javascript gatherer with this code in it:
If the search query is not anywhere in the page or the URL you would need to store it in a variable with javascript and either extract it from code or save it in a javascript variable and then add it to the current page as a new HTML element that then would be extracted with an Extract action. This would involve some coding though.
Code: Select all
return element.value;
Juan Soldi
The Helium Scraper Team
The Helium Scraper Team
-
- Posts: 20
- Joined: Thu May 12, 2011 4:05 pm
Re: Extracting Columns from your source table to another tab
HI,
In this case is the code actually "return element.value;"? When I set that up it seems to be frequently missing the text in googles search box
In this case is the code actually "return element.value;"? When I set that up it seems to be frequently missing the text in googles search box
Re: Extracting Columns from your source table to another tab
Hi,
Yes, that's how you'd get the text in any text box such as where you type your search query in Google. Actually, now there is a gatherer called Value so you don't need to write any JavaScript code. The only possible problems I can think of are, your kind is either selecting other than exactly 1 element in the page, or your kind is not selecting the text box itself. To ensure it selects the right element, press the Select kind in browser button and make sure the OuterHTML starts with the text "<input".
Yes, that's how you'd get the text in any text box such as where you type your search query in Google. Actually, now there is a gatherer called Value so you don't need to write any JavaScript code. The only possible problems I can think of are, your kind is either selecting other than exactly 1 element in the page, or your kind is not selecting the text box itself. To ensure it selects the right element, press the Select kind in browser button and make sure the OuterHTML starts with the text "<input".
Juan Soldi
The Helium Scraper Team
The Helium Scraper Team