Hi
I'm using a site that I query and that gives me a list of results that link to individual profile pages. I set up in my action tree a "Navigate Each" action that navigates through the links on the result pages to get to the individual profile pages. The site uses javascript, so I'm simulating click. Once I get to the individual profile pages I am extracting 8 different Kinds of data, then I'm using the Navigate action to navigate the "back" button.
The program will click through 1 or 2 results, then it gives me an error that says "The amount of elements to click have changed. Consider disabling the 'simulate click' option in your 'navigate each' action."
What does this error mean?
I'm guessing this error is because it's either not getting back to the original results page, or the HS is no longer recognizing the same number or results on that page.
I have tried this without the Navigate "back" button, and I have also tried this by setting my results page as my 'starting page' and having a 'go to starting page' action. I keep getting the same error.
I cannot disable the click because then I get an error "the given string is not a valid link"
How do I get around this error?
Thanks
Amount of Elements to Click Have Changed
Re: Amount of Elements to Click Have Changed
See if you can select these elements on whatever page you get this error. There should be the same amount of elements as when the Navigate Each action was originally executed.
You shouldn't need to use a go back action as the Navigate Each action will do this for you. My guess is that these elements are loading dynamically so they are still not there when the Navigate Each tries to find them. If this is the case, a Force Select action should fix it. You can access this premade from File -> Online Premades or at New Action -> Execute Actions Tree -> More... in any actions tree.
Let me know how this goes.
You shouldn't need to use a go back action as the Navigate Each action will do this for you. My guess is that these elements are loading dynamically so they are still not there when the Navigate Each tries to find them. If this is the case, a Force Select action should fix it. You can access this premade from File -> Online Premades or at New Action -> Execute Actions Tree -> More... in any actions tree.
Let me know how this goes.
Juan Soldi
The Helium Scraper Team
The Helium Scraper Team
Re: Amount of Elements to Click Have Changed
Thanks, I have been able to spend a little bit more time with this and I think I know the problem.
I believe the problem is with the navigate each action. I am navigating through a list of results that have 20 results per page and several hundred pages of results. The navigate each action works fine on the first page, and navigates to the first link on the second page fine, but when the navigate each goes back, it keeps going back to the first page of results instead of the second page (3rd page, 4th page, etc etc).
if the navigate each action returned to the correct results page instead of the first results page every time everything else would work.
thanks
I believe the problem is with the navigate each action. I am navigating through a list of results that have 20 results per page and several hundred pages of results. The navigate each action works fine on the first page, and navigates to the first link on the second page fine, but when the navigate each goes back, it keeps going back to the first page of results instead of the second page (3rd page, 4th page, etc etc).
if the navigate each action returned to the correct results page instead of the first results page every time everything else would work.
thanks
Re: Amount of Elements to Click Have Changed
This can happen when site stores your current page in a session instead of keeping it in the URL (you'll notice every page has the same URL or there is no information telling you which page you are at in the URL). What you can do here is extract the links to every details and turning the pages instead of using a Navigate Each, and then use a Navigate URLs to navigate to all of them.
Juan Soldi
The Helium Scraper Team
The Helium Scraper Team
Re: Amount of Elements to Click Have Changed
Thanks Juan,
I tried this, but the problem is that the links in the results page use java script, and there is no link URl to the individual profile pages visible in the source code. Thus, I can't Extract Links (no links to extract) then navigate links.
I can physically click on the links on the results page, and the profile page pops up, but it pops up outside of the helium scraper. even if it did pop up inside the helium scraper, I'd still be faced with the same "navigate each" problem we had, where it continually goes back to the first results page.
I ended up doing an incremental link navigation to get to the profile pages. Unfortunately this pulled both the "active" and "Inactive" profile pages (I just want active). I used Notepad++ to compare the source codes of the "inactive" and "active" profile pages, and both of them are identical at the SC level. So there's no way of separating them. So now I'm faced with going back through the results page (the results only shows 'active' profiles) and marking them on my export as 'active'.
Is there any other way to get around this "navigate each" problem?
I tried this, but the problem is that the links in the results page use java script, and there is no link URl to the individual profile pages visible in the source code. Thus, I can't Extract Links (no links to extract) then navigate links.
I can physically click on the links on the results page, and the profile page pops up, but it pops up outside of the helium scraper. even if it did pop up inside the helium scraper, I'd still be faced with the same "navigate each" problem we had, where it continually goes back to the first results page.
I ended up doing an incremental link navigation to get to the profile pages. Unfortunately this pulled both the "active" and "Inactive" profile pages (I just want active). I used Notepad++ to compare the source codes of the "inactive" and "active" profile pages, and both of them are identical at the SC level. So there's no way of separating them. So now I'm faced with going back through the results page (the results only shows 'active' profiles) and marking them on my export as 'active'.
Is there any other way to get around this "navigate each" problem?
Re: Amount of Elements to Click Have Changed
Is it possible for you to share this website for me to take a look at it?
If not, and if neither a results page nor each individual result details page have a URL that you can store in the database, then sometimes there is a way to build the URL from the javascript in each link to a details page. Sometimes it looks something like this:
Say this is the link:
And then the URL of the popup window will be something like "http://www.example.com/details/12345/index.php". So with some coding you should be able to build a URL this way.
But just to make sure, I understand neither each results page, nor each link to a details page (each of the links in each results page) have a URL that you can copy and paste into your browser to go back to the page? If you have any of these then storing them in the database would be the best solution.
If not, and if neither a results page nor each individual result details page have a URL that you can store in the database, then sometimes there is a way to build the URL from the javascript in each link to a details page. Sometimes it looks something like this:
Say this is the link:
Code: Select all
<a href="javascript:popUp('12345');">A Link</a>But just to make sure, I understand neither each results page, nor each link to a details page (each of the links in each results page) have a URL that you can copy and paste into your browser to go back to the page? If you have any of these then storing them in the database would be the best solution.
Juan Soldi
The Helium Scraper Team
The Helium Scraper Team