コード例 #1
0
def initialize():
    print('Initializing...')
    r.init()
    r.timeout(15)  #set timeout to wait longer
    r.url(URL)
    if r.exist('//*/button[@type="submit"]') == True:
        r.click('//*/button[@type="submit"]')  # Anti RPA by AirBnB
    print('Done.')
コード例 #2
0
def initialize():
    print('Initializing...')
    r.init()
    r.timeout(15)  #set timeout to wait longer
    r.url(URL)
    while r.exist('//*/button[@type="submit"]') == False:
        r.url(URL)
        print("Wrong page detected, retrying..")
    r.click('//*/button[@type="submit"]')  # Anti RPA by AirBnB
    print('Done.')
コード例 #3
0
def gestionar_uuii(uuii, codigoPostal, cto):
    r.url(uuii)
    r.timeout(120)
    if r.read('//*[@id="btnNew"]'):
        r.click('//*[@id="btnNew"]')
        r.timeout(120)
        if r.read('//*[@id="btnFormEditSave"]'):
            r.select('//*[@name="planta"]', 'BA')
            r.type('//*[@name="cp"]', codigoPostal)
            r.click('//*[@id="btnFormEditSave"]')
            if r.read('//*[@class="tableCell"]'):
                r.click('//*[@class="tableCell"]')
                r.click('//*[@id="btnRD"]')
                if r.read('//*[@id="btnFormRDSave"]'):
                    r.timeout(120)
                    r.select('//*[@name="rd"]', cto)
                    r.wait(5)
                    if r.read('//*[@id="ctoAddress_ctoName"]'):
                        r.click('//*[@id="btnFormRDSave"]')
                        if r.url('xxxx.do?dispatchMethod=rdSave'):
                            print('Gestionada')
コード例 #4
0
sheet.cell(row=1, column=2).value = 'Price'

r.init()

# get URL of old groceries order to re-add all items to cart
# r.url(r.ask('Paste the URL of Purchase History Link and login to Nintendo'))
# r.url('https://ec.nintendo.com/my/#/transactions/1')
r.url('https://ec.nintendo.com/my/#/')
t.sleep(7)

# click on purchase history if logged in
r.click(
    '/html/body/div[1]/div[2]/section/div[1]/section[2]/section/ul/li[3]/a/div[1]'
)
t.sleep(5)
r.timeout(300)
# set a maximum 5-minute timeout for user to login
# t.sleep(300)

# use exist() function with XPath to check if logged in
if not r.exist(
        '/html/body/div[1]/div[2]/section/div[1]/section[2]/div/div/section[1]/div[2]/div/div[1]/div[2]'
):
    r.dom('alert("Purchase History Page not detected after 5 minutes. Bye!")')

# then click on last item arrow
r.click(
    '/html/body/div[1]/div[2]/section/div[1]/section[2]/div/div/ni-pager/section/div/button[9]'
)

# field using css selector
コード例 #5
0
import rpa as r

r.init()
r.timeout(60)
r.count('exploitation')
r.url('https://www.macieenligne.ci/particulier')
r.wait(10)
r.url('https://www.macieenligne.ci/simuler_facture')
#r.type('//*[@name="exploitation"]','1')
r.type('//*[@name="nouvel_index"]', '1252522')

#r.select(600, 300, 600, 400)
#r.url('https://www.macieenligne.ci/eagence_mobile/simuler_facture')
#r.dclick()
#r.type('//*[@name="q"]', 'decentralization[enter]')
#print(r.read('result-stats'))
#r.snap('page', 'results.png')
r.close()
コード例 #6
0
  def sigaaRPA(self):
    r.init()
    r.timeout(30)

    while(self.state > 0):

      if self.terminateBot:
        r.close()
        break

      elif self.state == 1:
        # use url('your_url') to go to web page, url() returns current URL
        r.url('https://sigaa.upb.edu.co/ssomanager/c/SSB')
        self.state = self.state + 1

      elif self.state == 2:
        # use type() to use the keyboard to write something
        if r.exist(X.username) & r.present(X.username):
          r.type(X.username, '000290164')
          r.type(X.password, 'Tandres1997_')
          self.state = self.state + 1
        else:
          print("Couldn\'t find Username and Password Components")
          self.state = 1

      elif self.state == 3:
        # use click() to click on an UI element or x, y location
        self.state = click(X.login, self.state)

      elif self.state == 4:
        ## hace click en Estudiantes
        self.state = click(X.estudiantes, self.state)

      elif self.state == 5:
        ## Hace click en Seguimiento a la formación
        self.state = click(X.seguimieto, self.state)

      elif self.state == 6:
        ## hace click en Calificaciones parciales
        self.state = click(X.calif, self.state)

      elif self.state == 7:
        ## Selecciona el semestre del cual quiere mirar las notas
        r.select(X.semester, self.semester)
        self.state = self.state + 1

      elif self.state == 8:
        ## se hace click en enviar
        r.click(X.enviar)
        self.state = self.state + 1

      elif self.state == 9:
        tablexpath = ''
        r.wait(2)
        numCursos = r.count('//*[@class="datadisplaytable"][2]/tbody/tr/td/a')
        for i in range(2,numCursos+2):
          tablexpath = '//*[@class="datadisplaytable"][2]/tbody/tr['+ str(i) +']/td/a'
          if r.exist(tablexpath):
            r.click(tablexpath)
            r.wait(1)
            pagetitle = r.read('//div[@id="pagetitle"]')
            if pagetitle == 'Detalle de Calificación de Componente':
              materia = r.read('//*[@class="datadisplaytable"][1]/tbody/tr[5]/td[2]')
              print(materia)
              r.snap('page', './notas/s'+self.semester+'/'+ materia +'.png')
              # r.table('//table[@class="datadisplaytable"][2]', './csv/table'+str(i-1)+'.csv')
            r.dom('history.back()')

        # use wait() to wait for a number of seconds
        # default wait() is 5 seconds
        r.wait(5)
        self.terminateBot = True
      elif self.state == 10:
        r.dom('history.back()')