1. 程式人生 > >chrome init a browser with cookie

chrome init a browser with cookie

#encoding: utf-8
require "watir-webdriver"
#b = Watir::Browser.new(:firefox, {:profile => 'default'}) # watir webdriver


# Which is going to create a new user data directory where all the cookies, bookmarks, cache etc. 
# will be stored. Basically, create a new profile. 
# If such a folder doesn't exist, it will create it. 
# If it does exist, it will load the cookies/all related files from it.

# C:\Users\{replace_with_your_username}\AppData\Local\Google\Chrome\User Data
# cmd command: chrome --user-data-dir="f:/desktop/Chrome/User Data"
user_data = 'C:\Users\dengbeiquan\AppData\Local\Google\Chrome\User Data'
b = Watir::Browser.new :chrome, :switches => ["--user-data-dir=#{user_data}"] # same philosophy for selenium, just a bit of a different syntax.
b.goto 'www.baidu.com'
puts b.title

相關推薦

chrome init a browser with cookie

#encoding: utf-8 require "watir-webdriver" #b = Watir::Browser.new(:firefox, {:profile => 'default'}) # watir webdriver # Which is g

How to securely deliver desktop applications to a browser with Amazon AppStream 2.0

In this project, you’ll learn how to configure, manage, and stream desktop applications to your users with Amazon AppStream 2.0. AppStre

Pod init install報錯Unable to add a source with url

首先我們需要重新安裝cocoapods 如果出現下面報錯: You don’t have write permissions for the /usr/bin directory. 使用這條命令可以進入安裝: sudo gem install -n /usr

[PWA] Add Push Notifications to a PWA with React in Chrome and on Android

On Android and in Chrome (but not on iOS), it's possible to send push notifications with a PWA. We'll start by asking the user for permission to send them

【轉】We have a problem with promises

mem eas 也會 同步方法 side pos lld node-js should 這是我看的自認為最好的一篇講解如何使用Promise的文章,原文地址:http://fex.baidu.com/blog/2015/07/we-have-a-problem-with-p

dashDB - Creating a table with CLOB column type

sda lec ads rim bold classic science count gree In order to create a table with clob column type, the table has to be created with "ORGAN

Chrome 如何查看/修改Cookie

image chrom rom 技術 img .cn blog 分享 -1 Chrome 如何查看/修改Cookie

[CodeForces850C]Arpa and a game with Mojtaba

sqrt 作者 div 位數 line 為我 hash_map 整數 所有 題目大意:   給你一個包含n個數的數列,兩個人輪流對數列進行如下操作:   選擇一個質數p和一個正整數k,將數列中所有能被p^k整除的數除以p^k。   最後不能操作者負。   問先手

Codeforces 850C Arpa and a game with Mojtaba

得到 cond get 每次 while %d mem sizeof void 題意:給定一個正整數序列,兩人輪流對這個數列進行如下修改:選取一個素數p和一個整數k將序列中能整除p^k的數除以p^k,問誰有必勝策略。 借此復習一下sg函數吧,sg(x) = mex (

attempted to return null from a method with a primitive return type (Double).

span att 但是 sele 代碼 mysql from ive star <select id="getMaxHitEventId" parameterType="string" resultType="int"> select max(ap

[Codeforces 919F]A Game With Numbers

putc 選中 bob topsort 其余 esp body 相加 tmp Description 題庫鏈接 兩個人 Van♂ 遊戲,每人手上各有 \(8\) 張牌,牌上數字均為 \([0,4]\) 之間的數。每個人在自己的回合選自己手牌中數字不為 \(0\) 的一張與對

A - Playing with Paper (CodeForces - 527A)

names () end str force code clas 正方 log - 題目大意 給定的矩形,每次裁剪最大的正方形,直到最後剩下正方形,總共有多少個正方形。 - 解題思路 顯然,每次裁剪後,原來的寬和(長-寬)變成了現在的長和寬,直到長等於寬。 - 代碼

3.11 - 3.12 A day with Google

strong 山東 紀念 ffi 一次 機會 天發 一個 真的 補了一番遊記。 找了一個本科學弟一起去上海遊玩。本來老板還要我周一過去討論寒假閱讀的論文,總算是把討論時間挪到周六了。 興沖沖地買好車票後就開始期待上海Google office的神秘之旅。 update:媽呀

Styling a ListView with a Horizontal ItemsPanel and a Header

orm In ecif 技術 yellow SQ CI details this 原文 http://eblog.cloudplush.com/2012/05/23/styling-a-listview-with-a-horizontal-itemspanel-and-a-

IE/Firefox/Chrome等瀏覽器保存Cookie的位置

很多 顯示 style app file soft xxxx ubuntu ogl IE瀏覽器Cookie數據位於:%APPDATA%\Microsoft\Windows\Cookies\ 目錄中的xxx.txt文件 (裏面可能有很多個.txt Cookie文件)如:C:\

maximum sum of a subarray with at-least k elements.

ane rst tps required imu tor http from lar // Returns maximum sum of a subarray with at-least // k elements. static int ma

Ubuntu16.04安裝軟體提示E: Encountered a section with no Package: header錯誤

ubuntu16.04用sudo apt-get XXX 結果提示如下錯誤: [email protected]:~/bin$ sudo apt-get install lrzsz [sudo] password for kaka: Reading package lists... E

Chrome 清除特定網站的 cookie

清除全部網站的 cookie 比較簡單,但副作用也大,好些自動登陸的、自動填表的都丟失了。如果只是清除特定網站的 cookie,在 Chrome 裡的操作其實挺麻煩,因為這個配置隱藏太深了! 沒法,有時還真的需要,因此記錄一下: 在計算機上開啟 Chrome。 依次點選右

2014 ACM-ICPC - A:Built with Qinghuai and Ari Factor

http://codeforces.com/gym/100548/attachments Time limit 1000 ms Memory limit 262144 kB Description DISCLAIMER: All names, incidents, char

iOS - 解決Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named

轉載自: https://www.cnblogs.com/hero11223/p/8882732.html 1  本來cocopods沒有問題,最近建立專案,利用cocopods匯入第三方庫的時候,出現如下錯誤: [!] Unable to add a source with