Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
selenium problems
#1
Hey, guys,

I would like to automate a process with selenium on the trading platform https://app.stormgain.com. You should fill out the login form automatically, then open the page of the Crypto Miner and then click on the "Activate" button.

The login: WORKS

Going to the Miner page: WORKS

Clicking the button: ...
First of all, the whole mine side is in a iframe, which already causes enough headaches and which is probably also the main problem. But then the button doesn't even have an xpath or an id. I tried it via find_element_by_link_text, ...class_name, about ...tag_name, and on many more ways. Nothing. And I guess I'm obviously too stupid to say that with the iframe. Someone could give me a thought impetus or even send me the (perhaps not even so complicated) solution. You can find my code below.

Greetings

DonaldBug13


# Don't click the mining button manually, otherwise you'll have to wait four hours.
# The account and passwaord were just created for this script.

import selenium
import time
from selenium.webdriver.common.keys import Keys

account = 'xxxxx'
pwd = 'xxxxxx'

driver = selenium.webdriver.Chrome('/chromedriver_linux64/chromedriver')  # custimize this path to your own
driver.get('https://app.stormgain.com')
driver.maximize_window()
time.sleep(2)
login_button = driver.find_element_by_link_text('Sign in')
login_button.click()
username = driver.find_element_by_id('email')
username.send_keys(f'{account}')
password = driver.find_element_by_id('password')
password.send_keys(f'{pwd}', Keys.RETURN)
time.sleep(3)
find_miner = driver.find_element_by_link_text('Miner')
find_miner.click()
time.sleep(3)
# Problem 1: switch to iframe
# Problem 2: find the mining button and click
time.sleep(3)
driver.quit()
snippsat write Mar-10-2021, 11:48 AM:
xxx out passwords
Reply
#2
You can usually switch to iframe by this command.
driver.switch_to.frame(0)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,618 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020