Home >
other > Under the centos7 python3 selenium3.141 simulation log in user name input box type 1 will never ente
Under the centos7 python3 selenium3.141 simulation log in user name input box type 1 will never ente
python scriptsChrome_options=Options ()
Chrome_options. Add_argument (' - headless ')
Chrome_options. Add_argument (' - no - the sandbox)
Chrome_options. Add_argument (' - disable - gpu)
Chrome_options. Add_argument (' - disable - dev - SHM - the usage of ')
Chrome_options. Add_argument (' window - size=1920108-0 ')
Driver=webdriver. Chrome (' chromedriver 'options=chrome_options)
Driver. The get (' https://61.11.10.17:8080/xxxx/loc.to? Page=Logon ')
Driver. Find_element_by_name (' user '). Click ()
Time. Sleep (1)
Driver. Find_element_by_name (' user '). The clear ()
Time. Sleep (2)
Driver. Find_element_by_name (' user '). Send_keys (' 6517 ')
Print (driver. Find_element_by_name (' user '). Get_attribute (' value '))
Output to only 65 lost two, less 17
Use a for loop string input, the output 657 less 1
Replace send_keys with js ()
Driver. Execute_script (' document. GetElementsByName (" user "). The value="https://bbs.csdn.net/topics/6517" ')
The output is empty
Enlightened way for bosses