Solution Timeline

All versions (edits) of solutions to Web Scraper for business phone numbers appear below in the order they were created. Comments that appear under revisions were those created when that particular revision was current.

To see the revision history of a single solution (with diffs), click on the solution number (ie. "#1") in the upper right corner of a solution revision below.

← Bounty Expand all edits

Simple python function to search phone number on google

import requests
from bs4 import BeautifulSoup

c_name="walmart"
def check_number(c_name):
phone=[]
url = "https://www.google.com/search?source=hp&ei=bTDhW_3hBqHOjwSr5qGwDg&q="+c_name+\
"&oq=&gs_l=psy-ab.1.0.35i39k1l6.0.0.0.3353.2.1.0.0.0.0.0.0..1.0....0...1c..64.psy-ab..1.1.104.6...105.5kPiJ0DrZYM"
get_html = requests.get(url)
soup = BeautifulSoup(get_html.content,'html.parser')
p = soup.find_all('span',{'class':'A1t5ne'})
for i in p:
if i.text.startswith("1 "):
phone.append(i.text)
return phone

Simple python function to search phone number on google

import requests
from bs4 import BeautifulSoup

c_name="walmart"
def check_number(c_name):
phone=[]
url = "https://www.google.com/search?source=hp&ei=bTDhW_3hBqHOjwSr5qGwDg&q="+c_name
get_html = requests.get(url)
soup = BeautifulSoup(get_html.content,'html.parser')
p = soup.find_all('span',{'class':'A1t5ne'})
for i in p:
if i.text.startswith("1 "):
phone.append(i.text)
return phone