0

My python code to submit a value to Google:

from twill.commands import *
go('www.google.com')
showforms()
formclear('1')
fv("1", "q", "python")
showforms()
submit('btnG')

When it is run it shows the following error:

***MissingSchema: Invalid URL u'/search': No schema supplied. Perhaps you meant http:///search?*** 
0

1 Answer 1

1

The key is formaction('1', 'www.google.com/search'), So in your case:

from twill.commands import *
go('www.google.com')
showforms()
formclear('1')
fv("1", "q", "python")
formaction('1', 'www.google.com/search')
showforms()
submit('btnG')

As for getting the code to actually search, I'm not sure.

You can do a google search by url with "http://www.google.com/?q=" + searchFor"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.