Hỏi đáp

Chia sẻ kiến thức, cùng nhau phát triển

Selenium Login Gmail

4 năm trước 1.849 lượt xem 7 bình luận 4 năm trước

Em vừa học xong khóa Selenium trên Howkteam nhưng giờ em dùng Login gmail thì không được ạ, có cách nào khắc phục không ạ? Cảm ơn mọi người đã trả lời ạ! Dưới này là Code của em ạ!

 

Bình luận

Để bình luận, bạn cần đăng nhập bằng tài khoản Howkteam.

Đăng nhập
tqk2811 đã bình luận 4 năm trước

GoogleLoginExtension.GenerateExtension

string extPath = Directory.GetCurrentDirectory() + $"Profiles\\ext_{accGmail.UserName}";
GoogleLoginExtension.GenerateExtension(extPath, accGmail.UserName, accGmail.Pass, accGmail.Recovery);
string argument = $"--load-extension=\"{extPath}\" --user-data-dir=\"{ProfilePath}\" --user-agent=\"{UserAgent}\" \"https://accounts.google.com/\"";


Process process = new Process();
else process.StartInfo.FileName = "<đường dẫn tới chrome.exe>";
process.StartInfo.WorkingDirectory = new FileInfo(process.StartInfo.FileName).Directory.FullName;
process.StartInfo.Arguments = argument;
process.Start();
process.WaitForExit();

//Mở lại bằng selenium
 
   
   
   
   
   
   
   

 

 

 
Minh Sự Moderator đã bình luận 4 năm trước

Thêm thông tin chi tiết đi bạn, không được do lỗi hay không biết nguyên nhân? Nếu không biết nguyên nhân thì Show Code lên cho mọi người xem.

Bài viết
0
Câu hỏi
3
Bình luận
5