Categories
Uncategorized

Data Scrapting with Python

Data Scrapting with python of raspberry pi zero 2W. In order to extract data from dynamic web page, Selenium is a solution wih python. Selenium together with some useful module to link with browser (i.e. Chromedriver in pi os)will be imported and loaded. Web page(s) can be read by Chromedriver and Selenium will be used to search or interact with web page while browsing. When the target data was found, it will be extracted to the local machine for the use in future or immediate processing or provide feed back to the web page.

Example: webdig.py

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options

options=webdriver.ChromeOptions()
options.add_argument(‘headless’)
options.add_argument(‘–disable_gpu’)
ser=Service(“/usr/bin/chromedriver”)

driver=webdriver.Chrome(service=ser, options=options)
driver.get(“http://noteasy2.kmdns.net”)

title=driver.title
print (title)