Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running through a proxy and get more then first page of data. #7

Open
Dwoelper opened this issue Apr 18, 2020 · 2 comments
Open

running through a proxy and get more then first page of data. #7

Dwoelper opened this issue Apr 18, 2020 · 2 comments

Comments

@Dwoelper
Copy link

How do i get this to run through a proxy server?

also trying to make it loop so it can pull more then the first page.

@RichardModad
Copy link

I also wanted to make it loop.

By adding third argument, "pageNumber" you could manually add page number in command like "python3 yellow_pages.py pizza "Las Vegas",NV 2" but I get error: unrecognized arguments: 2

def parse_listing(keyword,place,pageNumber): url = "https://www.yellowpages.com/search?search_terms={0}&geo_location_terms={1}%2CNV&page={2}".format(keyword,place,pageNumber) print("retrieving ",url)

For a loop I am trying something like

pageCount = 1 for url in urls: url = "https://www.yellowpages.com/search?search_terms={0}&geo_location_terms={1}%2CNV&page={2}".format(keyword,place,counter) counter += 1

But this didn't work. I am kind of a newb but I think it should be fairly easy for someone with a lot of python skills to make this work.

@NoobBugHunter
Copy link

add this modification in def parse_listing()
for pages in range(1, 5+1): url = "https://www.yellowpages.com/search?search_terms={0}&geo_location_terms={1}".format(keyword, place) + f"&page={pages}"
and change pages range according to your need.

I also wanted to make it loop.

By adding third argument, "pageNumber" you could manually add page number in command like "python3 yellow_pages.py pizza "Las Vegas",NV 2" but I get error: unrecognized arguments: 2

def parse_listing(keyword,place,pageNumber): url = "https://www.yellowpages.com/search?search_terms={0}&geo_location_terms={1}%2CNV&page={2}".format(keyword,place,pageNumber) print("retrieving ",url)

For a loop I am trying something like

pageCount = 1 for url in urls: url = "https://www.yellowpages.com/search?search_terms={0}&geo_location_terms={1}%2CNV&page={2}".format(keyword,place,counter) counter += 1

But this didn't work. I am kind of a newb but I think it should be fairly easy for someone with a lot of python skills to make this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants