如何使用有效的登录名(让我保持登录状态),书签等启动chrome web驱动程序

时间:2019-05-29 13:05:13

标签: python-3.x selenium-chromedriver

我需要在chrome浏览器启动时启动chrome浏览器网络驱动程序,并使用有效的登录书签等。

我尝试加载我的chrome配置文件,但没有发现运气。

def split_overlaps(df):
    import sqlite3
    conn = sqlite3.connect(':memory:')
    input_df.to_sql('input_df', conn, index=False)

    sql_code = '''
    select
        a.item,
        a.start,
        a.end,
        b.start as start1,
        b.end as end1,
        a.discount,
        b.discount as discount1
    from 
        input_df a
    left join
        input_df b
    on
        a.item=b.item
    where
        a.start < b.end and
        b.start < a.end
    '''

    output_ = pd.read_sql_query(sql_code, conn)
    output_

    output1 = output_.groupby(['start','end']).filter(lambda x: len(x) == 1)

    output2 = output_[(output_['start'] < output_['start1']) |
              (output_['end'] < output_['end1'])]

    output2.loc[output2['start'] == output2['start1'], ['end']] = output2['end1']
    output2.loc[output2['start'] == output2['start1'], ['discount']] = output2['discount1']

    output2.loc[output2['start'] != output2['start1'], ['end']] = output2['start1'] - 1 

    output_df = pd.concat([output1, output2])

    output_df.rename(columns={'start1':'start',
                            'end1':'end',
                            'discount1':'discount'}, inplace=True)

    output_df = pd.concat([output_df.iloc[:,[0,1,2,5]]
                           , output_df.iloc[:,[0,3,4,6]]], sort=False).reset_index(drop=True)

    return output_df.drop_duplicates().sort_values(['start', 'end']).reset_index(drop=True)

我想用我的chrome浏览器加载chrome驱动程序,就像在google chrome中那样。

0 个答案:

没有答案