I'm trying to scrape paginated web, but it gives me the first page in every iteration. When I click it in the browser, the content is different.
url = "http://www.x.y/z/a-b#/page-%s"
for i in range(1, 10):
url2 = url % str(i)
soup = urlToSoup(url2)
print url2
# url2 changes in every iteration
# Here it will print the same product list in every iteration
This is the output:
http://www.x.y/z/a-b#/page-1
http://www.x.y/z/a-b#/page-2
http://www.x.y/z/a-b#/page-3
http://www.x.y/z/a-b#/page-4
http://www.x.y/z/a-b#/page-5
http://www.x.y/z/a-b#/page-6
http://www.x.y/z/a-b#/page-7
http://www.x.y/z/a-b#/page-8
http://www.x.y/z/a-b#/page-9
The pager item for the page 2 (and similarly 3, 4, ...) looks as follows
<a rel="nofollow" href="http://www.x.y/z/a-b#/page-2"> <span>2</span> </a>
Why the resulting page is different when I open the URL (via click or via address bar) in the browser and when I get it via the code?