小编Sub*_*ukh的帖子

无法在 python selenium 脚本中使用带有特殊字符“$”的密码

示例脚本:

\n\n
# -*- coding: utf-8 -*-\nfrom selenium import webdriver\nimport os\n\n#credentials\nUSERNAME = \'##########\'\nPASSWORD = \'#####$####\xe2\x80\x8b\'\n\n#load profile\nprofile = webdriver.FirefoxProfile()\nprofile.set_preference(\'browser.download.folderList\', 2)  # custom location\nprofile.set_preference(\'browser.download.manager.showWhenStarting\', False)\nprofile.set_preference(\'browser.download.dir\', os.getcwd())\n\n# following properties to suppress download popup screen\nprofile.set_preference("browser.helperApps.neverAsk.openFile", "text/csv")\nprofile.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/csv")\n\n# initialise driver with above profile\ndriver = webdriver.Firefox(profile)\n\n\n#make the request to the url\ndriver.get(\'https://api.instagram.com/oauth/authorize/?client_id=#################&redirect_uri=#############&response_type=token\')\n#browser.current_url\ndriver.implicitly_wait(5)\n\n#Enter username and password\nUsername = driver.find_element_by_css_selector(\'#id_username\')\nUsername.send_keys(USERNAME)\n\nPassword = driver.find_element_by_css_selector(\'#id_password\')\nPassword.send_keys(PASSWORD)\n\n#SignIn button click\nSignIn = driver.find_element_by_css_selector(\'.button-green\').click()\n
Run Code Online (Sandbox Code Playgroud)\n\n

正如你所看到的,我正在尝试验证 Instagram 应用程序。我无法传递具有特殊字符“$”的正确密码值。我收到以下错误。

\n\n
C:\\Python27\\python.exe "D:/Projects/#####/Instagram Data Extraction/ETL_Scripts/Instagram_auth.py"\nTraceback (most recent call last):\n  File "D:/Projects/######/Instagram Data Extraction/ETL_Scripts/Instagram_auth.py", line 35, in <module>\n    Password.send_keys(PASSWORD)\n  File "C:\\Python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webelement.py", …
Run Code Online (Sandbox Code Playgroud)

python selenium decode utf-8 python-unicode

4
推荐指数
1
解决办法
1815
查看次数

MySQL 多列索引

我有一个选择查询,我需要包含以下列(几乎表中的所有列):

SELECT  ANI,CALL_ID, DATE_TIME, ABANDON_RATE, CALL_TYPE, CAMPAIGN, CAMPAIGN_TYPE, CUSTOMER_NAME, DISPOSITION, DNIS, LIST_NAME, 
        SESSION_ID, SKILL, AGENT_EMAIL, AGENT_GROUP, THIRD_PARTY_TALK_TIME, AFTER_CALL_WORK_TIME, HOLD_TIME, CALL_TIME, HANDLE_TIME, IVR_TIME,
        MANUAL_TIME, TALK_TIME, QUEUE_WAIT_TIME, advertiserName, affiliateName, callerID, campaignName, ChargentSFA__Biling_Phone__c, CONTACT_CREATE_TIMESTAMP,
        CONTACT_ID, CONTACT_MODIFIED_TIMESTAMP, Date_Added, destinationPhoneNumber, leadsource, number1, salesforce_id, source, transactionID,
        IVR_PATH 
FROM call_data_report 
WHERE ANI= '123456' OR DNIS = '123456' 
ORDER BY DATE_TIME desc;
Run Code Online (Sandbox Code Playgroud)

此查询执行时间过长(超过 3 分钟)。为了提高查询性能,我在 where 子句中使用的列(即 ANI 和 DNIS)上创建了索引。

create index ani_idx on call_data_report(ANI,DNIS)
Run Code Online (Sandbox Code Playgroud)

但是,当我检查上述选择查询的 EXPLAIN 的输出时,它显示它没有使用索引。是因为所有这些专栏吗?我需要创建什么类型的索引来提高上述查询的性能。

注意:ANI 和 DNIS 的列中有 NULL 值。

谢谢!

mysql indexing sql-execution-plan

3
推荐指数
1
解决办法
4945
查看次数