需要考试的答案下载链接:http://www.gongxukexuexi.com/2019%E6%99%AE%E6%B3%95%E8%80%83%E8%AF%95%E7%AD%94%E6%A1%88%E8%87%AA%E5%8A%A8%E8%80%83%E8%AF%95.py.txt
na = browser.find_element_by_xpath('
需要考试的答案下载链接:http://www.gongxukexuexi.com/2019%E6%99%AE%E6%B3%95%E8%80%83%E8%AF%95%E7%AD%94%E6%A1%88%E8%87%AA%E5%8A%A8%E8%80%83%E8%AF%95.py.txt
na = browser.find_element_by_xpath('//*[@id="username"]')#这个是用户名
na.send_keys('这里输入账号名字')
mi = browser.find_element_by_xpath('//*[@id="password"]')#这个是密码
mi.send_keys('密码输入')
html = browser.page_source# 获取网页内容
html = bs(html,'lxml')
>>> html.text
'\n广西普法云平台\n\n\n\n广西普法云平台\n\n\n\n\n\n\n\n body{\n background: url(content/images/img-login-bg.png) top center no-repeat;\n background-size: 100% 100%;\n /* background: -webkit-linear-gradient(-30deg, rgba(210, 212, 223, 1) , rgba(151, 159, 182, 1));\n background: -o-linear-gradient(-30deg, rgba(210, 212, 223, 1) , rgba(151, 159, 182, 1));\n background: -moz-linear-gradient(-30deg, rgba(210, 212, 223, 1) , rgba(151, 159, 182, 1));\n background: linear-gradient(to -30deg, rgba(210, 212, 223, 1) , rgba(151, 159, 182, 1)); */\n overflow: auto;\n }\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n关注广西普法,\n\n\n\n\n\n\n\n\n\n\n\n×\nddf\n\n\ndfdfd\n\n\n\n\n\n\n\n跳转到APP下载页\n\n\n\n\n\n\n\n\n\ndocument.write(\'<script src="./js/api.js?t=\' + new Date().getTime() + \'"><\\/script>\')\n\n\n\n\n\n\n var gFingerPrint=\'\';\n $(document).ready(function(){\n var browerType = myBrowser();\n if ( !(browerType == \'FF\' || browerType == \'Chrome\') )\n {\n location.href=\'./not_support.html\';\n return;\n }\n //获取通知信息\n getNoctice();\n\n //先获取指纹\n setTimeout(\n Fingerprint2.get(function(components) {\n gFingerPrint = Fingerprint2.x64hash128(components.map(function (pair) { return pair.value }).join(), 31); \n console.log("fingerprint hash",gFingerPrint);\n if (null == gFingerPrint || gFingerPrint == undefined || gFingerPrint == \'\'){\n alert(\'获取指纹信息失败\');\n return;\n }\n\n //指纹获取成功,获取验证码\n $("#verifyImg").attr("src",api.loginVerifyCodeUrl);\n\n //注册按钮函数\n $("#btnLogin").click(function(){\n if ($.trim($("#username").val())==\'\'){\n alert(\'请输入用户名\')\n return false;\n }\n if ($.trim($("#password").val())==\'\'){\n alert(\'请输入密码\')\n return false;\n }\n if ($.trim($("#verifyCode").val())==\'\'){\n alert(\'请输入验证码\')\n return false;\n }\n $.ajax({\n type: \'POST\',\n //url: api.loginUrl, //old server\n url: \'http://login.gxpf.cn/rest/api/login/loginUserCheck\', //new \n data: {\n \'account\':$("#username").val(),\n \'password\':$("#password").val(),\n \'vkckey\':$.cookie("vkc"),\n \'verifyCode\':$("#verifyCode").val(),\n \'fingerPrint\': gFingerPrint\n },\n dataType:\'json\',\n success: function(res){\n console.log(res)\n //alert(res.result[0].a_tokenId)\n if (res.status==200){\n $.cookie("cookie_a_st",res.result[0].a_st)\n $.cookie("cookie_a_code",res.result[0].a_code)\n $.cookie("cookie_a_tokenId",res.result[0].a_tokenId)\n $.cookie("cookie_a_userId",res.result[0].a_userId)\n location.href=\'./index.html\'\n }else if (res.status==535){\n alert("当前设备登录人数超限!");\n }else{\n //alert(res.message);\n if ( res.message.indexOf(\'APP\') >= 0) \n showModal("信息",res.message);\n else\n alert(res.message);\n if(res.status==534){\n $("#verifyImg").attr("src",api.loginVerifyCodeUrl+"?v="+Date.parse(new Date()))\n $("#verifyCode")[0].focus()\n }else if(res.status==533){\n $("#password")[0].focus();\n }else{\n $("#username")[0].focus();\n }\n }\n return false;\n },\n error: function (jqXHR, textStatus, errorThrown) {\n /*弹出jqXHR对象的信息*/\n //alert(jqXHR.responseText);\n //alert(\'jqXHR:\'+jqXHR.status);//NGINX错误码\n console.log(jqXHR.status)\n if (jqXHR.status==502){\n location.href=\'./many.html\'\n }\n //alert(jqXHR.readyState);\n //alert(jqXHR.statusText);\n /*弹出其他两个参数的信息*/\n // alert(textStatus);\n //alert(errorThrown);\n }\n });\n });\n \n $("#verifyImg").click(function(){\n $(this).attr("src",api.loginVerifyCodeUrl+"?v="+Date.parse(new Date()))\n })\n\n var flag = IsPC(); //true为PC端,false为手机端\n if (!flag){\n location.href=\'http://examwap.gxpf.cn\'\n }\n\n }), 1000);\n\n \n \n \n \n })\n\n\n function getNoctice()\n {\n var res = syncGetDotJson(\'http://cdn.gxpf.cn/cdndata/notice.json\',{});\n var content="";\n if ( null !=res && undefined != res) {\n content = res.content;\n }\n $("#noticeInfo").empty();\n $("#noticeInfo").append(content);\n\n }\n\n function IsPC() {\n var userAgentInfo = navigator.userAgent;\n var Agents = ["Android", "iPhone",\n "SymbianOS", "Windows Phone",\n "iPad", "iPod"];\n var flag = true;\n for (var v = 0; v < Agents.length; v++) {\n if (userAgentInfo.indexOf(Agents[v]) > 0) {\n flag = false;\n break;\n }\n }\n return flag;\n }\n\n\n function showModal(title, content) { \n \n // 显示模态框\n $(\'#noticeTitle\').empty();\n $(\'#noticeTitle\').append(title);\n $(\'#noticeContent\').empty(); \n $(\'#noticeContent\').append(content); \n $(\'#noticeModal\').modal(\'show\');\n }\n\n\n'