I am trying to make a YellowPages scrape to capture the following information into a csv file.
Business Name
Address
Phone Number
website URL
Issue I am having:
Yellow Pages does not have all the information for each listing. When I scrape the page with Scrape Attribute, add item to List to List then save the table to a CSV file, everything gets out of line. The wrong address will be with the wrong business.
I tried to do an if then statement with a condition for <div class="rank pin">:
if <div class="rank pin"> then website, address, phone and business name to list "A"
Else if <div class="rank"> then website, address, phone and business name to list "B"
Yellow Pages has the information available (address, phone and business name) when <div class="rank pin">. I was trying to only capture the information if the <div class="rank pin"> is true. However, the if statement works for the entire page, not specific table space in the web page.
Yellowpages Scrape
in Scripting
Posted
I am trying to make a YellowPages scrape to capture the following information into a csv file.
Issue I am having:
Yellow Pages does not have all the information for each listing. When I scrape the page with Scrape Attribute, add item to List to List then save the table to a CSV file, everything gets out of line. The wrong address will be with the wrong business.
I tried to do an if then statement with a condition for <div class="rank pin">:
Yellow Pages has the information available (address, phone and business name) when <div class="rank pin">. I was trying to only capture the information if the <div class="rank pin"> is true. However, the if statement works for the entire page, not specific table space in the web page.
help would be greatly appreciated.
Thanks,
mike