web browser created by spynner not responding

170 views Asked by At

I am trying to use spynner for web scraping ... below I used www.google.com as an example .... I want to automatically search for "Barack Obama" using spynner ... However, the web browser created by spynner keeps not responding ... and the search string ("Barack Obama") is not filled in the search box (You will see it when you run the code below yourself).

import spynner

browser = spynner.Browser()
browser.show()

browser.load("https://www.google.com")
browser.wait_page_load()

browser.fill("input[name=q]", "Barack Obama")
browser.click("input[name=btnK]")

The input fields are identfied correctly in my code ... you can check for yourself. ... So why is this not working?

1

There are 1 answers

0
Jurica Penjgušić On

Trie this code snippet.. I used qt

import spynner

from PyQt4.QtCore import Qt



b = spynner.Browser()
b.show()
b.load("http://www.google.com")
b.wk_fill('input[name=q]', 'soup')


b.sendKeys("input[name=q]",[Qt.Key_Enter])
b.browse()