0

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?

steady_progress
  • 3,311
  • 10
  • 31
  • 62
  • `wait_page_load` should be `wait_load`, `fill` shuld be `wk_fill`, and if you want the browser to be responsive you should call `browser.browse()` – Tomer Jun 21 '15 at 15:45

1 Answers1

0

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()