I have below WATIR code, which will download series of web pages by
navigating thru page number. Each search will present series of
pages, and the last page in the series does not contain the text
'Next'.
However, below code keeps running and goes on presenting the last page
that does not contain the text "Next". It seems to me that the while
condition is true to the page right before the last page, and this
page right before the last page contains the text, "Next", and it
never goes out of the loop, [ ... while ie.contains_text
("Next")......].
Is there anyway to make it get out of the loop? The last page surely
does not contain the text, "Next", but it seems to me that below code
does not detect it.
Any help / suggestion will be deeply appreciated.
Thank you.
----------------------------------------------------------------------------------------------------------------------------------------
while ie.contains_text("Next")
File.open("#{PageNo}.html", "wb") { |f|
f << '<html>'
f << ie.html
f << '</html>'
PageNo = PageNo + 1
ie.goto("http://www.test.com/#{PageNo}"
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---