niklasb / dryscrape

[not actively maintained] A lightweight Python library that uses Webkit to enable easy scraping of dynamic, Javascript-heavy web pages
http://dryscrape.readthedocs.io/
MIT License
533 stars 67 forks source link

dryscrape console.log #64

Closed JulienSoda closed 7 years ago

JulienSoda commented 7 years ago

Hello, congratulation for dryscrape.

Is it possible, with dryscrape, to get console.log(), like selenium: for entry in driver.get_log('browser'): print(entry)

Best regards

JulienSoda commented 7 years ago

I Try:

hello = sess.eval_script('console.log("Hello World1");') print(hello) hello2 = sess.eval_script('document.write("Hello World2");') print(hello2)

But no result: None None

JulienSoda commented 7 years ago

succeded:

hello4 = sess.eval_script("function hello4(){ return 10;};hello4();") print(hello4)

the script return: 10

niklasb commented 7 years ago

This is not implemented. I would be happy to consider accepting this as a pull request.