-2

I'm trying to fetch some info from this Link. The data i wanna fetch is that company name, email, phone, location and paste it in the excel sheet. Please suggest some fromework / a way to scrape the data and write it to the xls. I know xlwt is one framework.

The code i have written to open a tab and fetch info is given below:

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import time


browser = webdriver.Firefox() # Get local session of firefox

# 0 wait until the pages are loaded
browser.implicitly_wait(3) # 3 secs should be enough. if not, increase it

browser.get("http://ae.bizdirlib.com/taxonomy/term/1493") # Load page
#links =[]
#link=browser.find_elements_by_class_name('term-listing-heading')
#links = browser.find_elements_by_css_selector("h2 > a")

#print link
#for link in links:
#    link.send_keys(Keys.CONTROL + Keys.RETURN)
#    link.send_keys(Keys.CONTROL + Keys.PAGE_UP)
#    time.sleep(2)
#    link.send_keys(Keys.CONTROL + 'w')
Python Learner
  • 129
  • 1
  • 11

1 Answers1

0

Try using this python example to help you learn how to scrape the page, then use openpyxl to create an excel sheet.

ask
  • 11
  • 2