google form - Browser() in Python shows errors in IDLE -
i have code here bot spams specific google form:
while true: browser = browser() print("form filling begun") browser.visit('https://docs.google.com/forms/d/1lyoox1fipop5ncevhqmda3exqf8pmcxabgwiyq67yx8/viewform?c=0&w=1') browser.fill('entry.1796849606', 'test') browser.fill('entry.1233774681', 'test') browser.fill('entry.1687034525', 'test') browser.fill('entry.2085519362', 'test') browser.fill('entry.2085519362', 'test') browser.fill('entry.87435301', 'test') browser.find_by_name('entry.434307791', 'test') browser.find_by_name('submit').click() print("form filled") browser.quit() time.sleep(10)
when ran in idle, said there problem on line 2. browser() wasn't defined. now, know friend able accomplish this code, i'm not sure what's wrong. i'm sure it's basic problem, i'm complete n00b @ python, don't know do.
thanks,
sam.
edit: went on splinter website , put own sample code in idle, see happens , console showing
traceback (most recent call last): file "c:/users/sam/desktop/test.py", line 3, in <module> browser() browser: file "c:\python27\lib\site-packages\splinter\browser.py", line 63, in browser return driver(*args, **kwargs) file "c:\python27\lib\site-packages\splinter\driver\webdriver\firefox.py", line 39, in __init__ self.driver = firefox(firefox_profile) file "c:\python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 82, in __init__ keep_alive=true) file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 87, in __init__ self.start_session(desired_capabilities, browser_profile) file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 141, in start_session 'desiredcapabilities': desired_capabilities, file "c:\python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 201, in execute self.error_handler.check_response(response) file "c:\python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response raise exception_class(message, screen, stacktrace) webdriverexception: message: a.addeventlistener not function
i'm out of depth here. when opened browser window, url about:blank&utm_content=firstrun
. mean??
do import browser? try:
from splinter.browser import browser
Comments
Post a Comment