cloudy-sfu/Web-crawler-weibo

Optimize `login_windows`

cloudy-sfu opened this issue · 1 comments

  • Leverage start-up option of webbrowser.
  • Remove selium and still use default Chrome (unlocked cookies)
import webbrowser

def open_with_option(url, option):
    """
    Open the default browser with a startup option.
    
    :param url: The URL to open.
    :param option: The startup option to use.
    """
    browser = webbrowser.get()
    if hasattr(browser, 'remote_args'):
        browser.remote_args.append(option)
    elif hasattr(browser, 'args'):
        browser.args.append(option)
    browser.open(url)

Not feasible.