How does Yandex do its trick?

How does Yandex do its trick?

I want to programatically get the contents of a Yandex.com search result.

The proglem is that a search page url does not change when you do a search on yandex.com and advance to see more pages. It must be done somehow by javascript. Any ideas?

It does use JavaScript, but you can also get the next page’s results by simply appending a “p” parameter on to the URL.

For example:

http://www.yandex.com/yandsearch?text=javascript&p=3

That works.

Thanks.

How did you figure this out?

Another web site search engine also does this trick. I am talking about www.duckduckgo.com which is also a very popular search engine. It too does not display a different URL in the address bar of the browser as I advance through more content.

And the display for
http://duckduckgo.com/?q=javascript&p=100
is no different from
http://duckduckgo.com/?q=javascript

When I tried
http://duckduckgo.com/?q=javascript&page=1
it thew a 403 forbidden error.

DuckDuckGo uses a <noscript> tag to display a message asking uses without JavaScript to visit [FONT=courier new]https://duckduckgo.com/html[/FONT] which uses straight up page reloads to paginate the results using the POST method. Other then that it offers no other way of manually going through the results when JavaScript is enabled.

https://duckduckgo.com/html/?q=javascript

I looked in Chrome Web Developer Tools to see what URL the AJAX request was being made to when the “More” button was clicked. Had a look at all the parameters and “p” was one that was changing with every request, so I figured I’d try it out in the main URL to see what would happen :wink: