Python reset IE proxy for use after SS recovery

Source: Internet
Author: User
Tags xpath python script

After each use of the SS client, the browser agent will not be changed back, do not want to manually change, can only be processed with Python script.

1 Importwinreg2 defdisableproxy ():3Proxy =""4XPath ="software\microsoft\windows\currentversion\internet Settings"5     Try:6Key =winreg. Openkey (winreg. HKEY_CURRENT_USER, XPath, 0, WinReg. Key_write)7WinReg. SetValueEx (Key,"proxyenable", 0, WinReg. REG_DWORD, 0)8WinReg. SetValueEx (Key,"ProxyServer", 0, WinReg. REG_SZ, proxy)9     exceptException as E:Ten         Print("ERROR:"+str (e.args)) One     finally: A None - if __name__=='__main__': -     Try: the Disableproxy () -     exceptException as E: -         Print("ERROR:"+str (e.args)) -     finally: +         Pass

Python reset IE proxy for use after SS recovery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.