I'm doing a code to enter a platform. It has a URL which I access and log in through Mechanize.
import mechanize
br = mechanize.Browser()
br.set_handle_robots(False)
br.addheaders = [('User-agent','Chrome')]
#URL del Login
br.open('https://platform.ttt/en/login')
br.select_form(nr=0)
#Info del Login, Buscar forms desde la pagina y donde dice 'username' ponemos el name cuando inspeccionamos en el browser!
br.form['username'] = 'martin@ttt'
br.form['password'] = 'martinttt'
#Logueate
sub = br.submit()
#Url logueado
print sub.geturl()
#Cambio de URL
br.open('https://ttt/en/users/inventory/43a05221-5760-4eba-a40d-087856e79fbb/general')
print br.geturl()
With this code, just log in and change url. Within the new URL I need to click on: <a id="clone-btn" href="javascript:void(0);">Duplicate</a>
I thought about clicking on the href but I can not then maybe I can select it through the ID.
To be more clear, I need to be able to click clone-btn
Thanks