Pustaka Taratsa

Baca teks (EPUB): Python: Selenium Crawler

1 bagian

Teks ini diambil langsung dari berkas EPUB; tata letak dan gambar tidak disertakan. Untuk tampilan lengkap, silakan merujuk pada dokumen asli.

Daftar isi
  1. Python: Selenium Crawler
  2. Quickstart
  3. Referensi

Python: Selenium Crawler

Sumber: https://onnocenter.or.id/wiki/index.php/Python:_Selenium_Crawler

WARNING masih belum jalan / saya tidak bisa install / pakainya dengan benar

Quickstart

pip install -e git+https://github.com/cmwslw/selenium-crawler.git#egg=selenium-crawler
from seleniumcrawler import handle_url
print handle_url('https://news.ycombinator.com/item?id=5626377')

This will open up a browser window, 'click' on the main link, and load the article. It will print the following:

{
    'url': 'http://googleblog.blogspot.com/2013/04/google-now-on-your-iphone-and-ipad-with.html',
    'source': Template:HTMLSOURCE,
    'handler': 'hnews'
}

Where Template:HTMLSOURCE is the actual HTML of the article.

Referensi