19 March 2022

How to open an URL in Chrome incognito mode using Python?

You may refer to the sample codes below from us. We use Windows platform as an example:


import webbrowser

def main():
    fUrl: str = 'https://prgexp.blogspot.com/'

    chrome_path = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
    webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chrome_path))
    webbrowser.get('chrome').args.append('--incognito')
    webbrowser.get('chrome').open_new_tab(fUrl)

if __name__ == '__main__':
    main()

Do I need public IP for Azure VM?

 If you need to connect to your Azure VM from internet (means your home or your office), then yes, you will need to assign a public IP to your Azure VM.

If you prefer to access your Azure VM from Azure Portal, then you may not need any public IP.

More details at this article from Microsoft: https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/associate-public-ip-address-vm


Tips: You can save money if you do not assign any public IP on your Azure VM.