Python 3.5 with Selenium Webdriver, 485 427 469 461 449 414 403 bytes:
from selenium.webdriver import*;import time;D=Chrome();I=lambda k:D.find_element_by_name(k);C='comment';D.get('http://www.codegolf.stackexchange.com/users/login');I('email').send_keys(U);Z=I('password');Z.send_keys(P);Z.submit();D.get('http://www.codegolf.stackexchange.com/questions/84546');D.find_element_by_link_text('add a '+C).click();E=I(C);E.send_keys('1234567890123456');time.sleep(1);E.submit()
A full program utilizing a simple Python selenium web driver solution. Works in Chrome, although it needs ChromeDriver installed to work. Works by renaming U
and P
to the user's Stack Exchange email and password, respectively. However, if there are any issues getting ChromeDriver installed, here is a FireFox solution that gets executed in the exact same manner as the above solution and does not need any drivers, although it is currently 1 byte longer at 414 404 bytes:
from selenium.webdriver import*;import time;D=Firefox();I=lambda k:D.find_element_by_name(k);C='comment';D.get('http://www.codegolf.stackexchange.com/users/login');I('email').send_keys(U);Z=I('password');Z.send_keys(P);Z.submit();D.get('http://www.codegolf.stackexchange.com/questions/84546');D.find_element_by_link_text('add a '+C).click();E=I(C);E.send_keys('1234567890123456');time.sleep(1);E.submit()
Also, if a function is wanted, here is a solution using an anonymous lambda function, currently standing at 513 455 497 489 477 449 431 bytes and using Chrome as the browser.
lambda U,P:exec("from selenium.webdriver import*;import time;D=Chrome();I=lambda k:D.find_element_by_name(k);C='comment';D.get('http://www.codegolf.stackexchange.com/users/login');I('email').send_keys(U);Z=I('password');Z.send_keys(P);Z.submit();D.get('http://www.codegolf.stackexchange.com/questions/84546');D.find_element_by_link_text('add a '+C).click();E=I(C);E.send_keys('1234567890123456');time.sleep(1);E.submit()",locals())
However, if there are, again, any issues regarding ChromeDriver, here is the same type of solution but this time using Firefox, currently standing at 442 432 bytes:
lambda U,P:exec("from selenium.webdriver import*;import time;D=Firefox();I=lambda k:D.find_element_by_name(k);C='comment';D.get('http://www.codegolf.stackexchange.com/users/login');I('email').send_keys(U);Z=I('password');Z.send_keys(P);Z.submit();D.get('http://www.codegolf.stackexchange.com/questions/84546');D.find_element_by_link_text('add a '+C).click();E=I(C);E.send_keys('1234567890123456');time.sleep(1);E.submit()",locals())
You call these lambda functions by simply renaming the function as anything valid and then calling with your email and password like a normal function. For instance, if the function were named H
, you would call it like H(Email, Password)
.