Hello, I'm in need of help.
Are there any other similar and simpler alternatives than selenium that I can use in prefect?
From what I'm seeing, selenium is going to end up giving me a lot of work to implement.
I just wanted to know if there are any alternatives to selenium that I can use in prefect.
✅ 1
k
Kevin Grismore
08/24/2022, 3:41 PM
What are you using selenium to accomplish?
l
Lucas Brum
08/24/2022, 4:08 PM
I wanted to make an algorithm that logs into my Google account and takes a token.
k
Kevin Grismore
08/24/2022, 4:13 PM
depending on what steps are required, you may be able to use python's
requests
package
l
Lucas Brum
08/24/2022, 5:23 PM
I tried already, but I didn't succeed
I used this script here:
Copy code
from bs4 import BeautifulSoup
import requests
my_email = "email" # my email is here
my_pass = "password" # my password is here
url = "<https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=105273681273-sbo8hk12smk1uh2jgii9v09i4kf1ns24.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=MyEVvIsAytjJjqXvqeOyUA1ZjiJF4R&prompt=consent&access_type=offline>"
form_data = {'Email': my_email, 'Passwd': my_pass}
post = "<https://accounts.google.com/signin/challenge/sl/password>"
with requests.Session() as s:
soup = BeautifulSoup(s.get("<https://mail.google.com>").text, "html.parser")
for inp in soup.select("#gaia_loginform input[name]"):
if inp["name"] not in form_data:
form_data[inp["name"]] = inp["value"]
s.post(post, form_data)
html = s.get("<https://mail.google.com/mail/u/0/#inbox>").content
# Prints 'False', should print 'True'
print(my_email in s.get('<https://mail.google.com/mail/u/0/#inbox').text)>
Lucas Brum
08/24/2022, 5:27 PM
And it's not just logging in, you have to navigate some options until the token appears
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.