Example #1
0
def basicSearch():
    # Retirado do Site do Nerodia, para teste inicial #
    browser = Browser(browser='chrome')
    browser.goto('google.com')

    search_input = browser.text_field(title='Pesquisar')
    search_input.value = 'nerodia'
    browser.button(value='Pesquisa Google').click()

    browser.close()
#!/usr/bin/env python3
from nerodia.browser import Browser
import re

loginsite = "https://mggym-borken.lms.schulon.org/login/index.php"

browser = Browser(browser='firefox')
browser.goto(loginsite)
usrn = browser.text_field(name="username")
usrn.value = ''
pswd = browser.text_field(name="password")
pswd.value = ''
browser.button(value='Login').click()

html = browser.html

#print(html:=browser.html)
matches = re.findall(
    '<span.*>Meine Kurse<\/span>.*href="(https:\/\/mggym-borken.lms.schulon.org\/course\/view.php\?id=\d+)">.*href="(https:\/\/mggym-borken.lms.schulon.org\/course\/view.php\?id=\d+)">.*href="(https:\/\/mggym-borken.lms.schulon.org\/course\/view.php\?id=\d+)">',
    html)
kurse = list(matches[0])
#print(kurse)

for kurs in kurse:
    browser.goto(kurs)
    html = browser.html
    matches = re.findall(
        'href="(https:\/\/mggym-borken\.lms\.schulon\.org\/mod\/resource\/view.php\?id=\d+)"><img src="https:\/\/mggym-borken\.lms\.schulon\.org\/theme\/image\.php\/classic\/core\/1587401819\/f\/pdf-24"',
        html)
    print(matches)
Example #3
0
from nerodia.browser import Browser
from time import sleep  # needed to perform sleep
from faker import Faker  # needed for fake form data
import os  # needed for file path

# Setup
browser = Browser(browser='chrome')
browser.window().maximize()

# Navigate to the Page
browser.goto('a.testaddressbook.com')

# Authenticate and Navigate to the Form
browser.link(id='sign-in').click()
browser.text_field(data_test='email').set('*****@*****.**')
browser.text_field(data_test='password').set('password')
browser.button(name='commit').click()
browser.link(data_test='addresses').click()
browser.link(data_test='create').click()

# This uses the Faker Library to give us Random Data.
# Read more about Faker Library here: https://pypi.org/project/Faker/

fake = Faker()  # So we can use fake.name() instead of Faker().name()
browser.text_field(id='address_first_name').set(fake.first_name())
browser.text_field(id='address_last_name').set(fake.last_name())
browser.text_field(id='address_street_address').set(fake.street_address())
browser.text_field(id='address_secondary_address').set(
    fake.secondary_address())
browser.text_field(id='address_city').set(fake.city())
from nerodia.browser import Browser

browser = Browser(browser='chrome')
browser.goto(
    'http://wp.curve.in.th/wp-login.php?loggedout=true&wp_lang=en_US&jetpack-sso-show-default-form=1'
)
t = browser.text_field(id='user_login')
t.value = '**'

t = browser.text_field(id='user_pass')
t.value = '***'

browser.button(id='wp-submit').click()
browser.wait_until(timeout=2,
                   interval=0.5,
                   method=lambda e: e.title.startswith("Dashboard"))

posts = []
for i in range(1, 6):
    browser.goto(f'http://wp.curve.in.th/wp-admin/edit.php?paged={i}')

    for t in browser.trs(class_name="type-post"):
        p = {}
        date = t.td(class_name="date").span().text
        date = date.replace("/", "-")
        p["date"] = date
        link = t.div(class_name="row-actions").span(
            class_name="view").link().href
        p["view_link"] = link

        p["name"] = link.replace("http://wp.curve.in.th/", "")
Example #5
0
import re
from selenium import webdriver
import json

BASE = "https://herdt-campus.com"

fp = webdriver.FirefoxProfile('/home/bf/.mozilla/firefox/a67xxtyb.auto')
driver = webdriver.Firefox(fp)

#browser = Browser(browser='firefox')

browser = Browser(driver)

browser.goto('https://bk-ostvest.lms.schulon.org/mod/url/view.php?id=16833')

usrn = browser.text_field(name='username')
usrn.value = ''
pswd = browser.text_field(name='password')
pswd.value = ''
browser.button(value='Login').click()

browser.button(value='Ich stimme zu!').click()

katalog = re.findall(
    r'<a class="catalog-nav-link" href="(\/category\/herdt-themen\/[\w\/\- ]*)">[\w\/\- ]*<\/a>',
    browser.html)

categorieDict = dict()

for category in katalog:
    #browser.goto(category)
Example #6
0
from nerodia.browser import Browser

browser = Browser(browser='firefox')
browser.goto("http://toolsqa.com/automation-practice-form/")
print(browser.title)

browser.text_field(name="firstname").clear()
browser.text_field(name="lastname").clear()
browser.text_field(name="firstname").set("Fname")
browser.text_field(name="lastname").set("Lname")

browser.close()
Example #7
0
                    browser.back()
            elif 'Directory' in item.text:
                # print(f'Checking Folder {item.text}')
                browser.goto(browser.url + '/' +
                             item.text.replace('Directory', '').strip())
                file_recursion()
                browser.back()
    except:
        print('Empty Repo')


# start browser
browser = Browser(browser='chrome')
browser.window().maximize()
browser.goto('https://bitbucket.paya.com/projects')
browser.text_field(id='j_username').send_keys(os.environ['username'])
browser.text_field(id='j_password').send_keys(os.environ['passsword'])
browser.button(id='submit').click()
total_files_bb = 0
file_ending = re.compile(
    r'(\w+\.config\b|\w+\.cs\b|\w+\.vb\b|\w+\.js\b|\w+\.json\b|\w+\.txt\b|\w+\.yml\b)'
)
connectionstring = re.compile(
    r'([uU]ser\s[iI][dD]=[\S]+;|[pP]assword=[\S]+;|[dD]atabase=[\w0-9\-]+;|[sS]erver=[\w0-9\-\\]+;)+'
)

table = browser.table(id='projects-table')
print(f'Number of Projects = {sum(1 for e in table)-1}')
bad_strings = [
    'Description', 'AutomationCoreCode', '-old', "-OLD", 'APIGEE', 'Boomtown',
    'CARD_API', 'CoreDataServices', 'CoreProcesses', 'Core_project',
Example #8
0
    css=
    "#content > div.vc_row.wpb_row.vc_row-fluid.dt-default > div > div > div > div.vc_message_box.vc_message_box-standard.vc_message_box-rounded.vc_color-info > p:nth-child(2) > em > strong"
)
print(text2)

text3 = browser.element(
    text=
    "Always click on the ads display at the right side, this is how we manage the website’s expenses and bring free content for the beginners."
)
print(text3.text)

browser.link(text="Partial Link Test").wait_until_present().click()
browser.link(text="Link Test").wait_until_present().click()
browser.back()

browser.text_field(name="firstname").wait_until_present().set("Fname")
browser.text_field(name="firstname").clear()
browser.select_list(id="continents").select("Antartica")
browser.select_list(id="selenium_commands").select("Switch Commands")
browser.button(id="submit")

browser.radio(id="sex-0").set()
browser.radio(id="sex-1").set()
browser.radio(id="exp-2").set()
browser.text_field(id="datepicker").set("mmddyy")
browser.checkbox(value="Automation Tester").set()
browser.checkbox(id="profession-0").set()

browser.link(text="Test File to Download").click()
browser.checkbox(id="tool-0").set()
browser.checkbox(id="tool-0").clear()
Example #9
0
from nerodia.browser import Browser

browser = Browser(browser='firefox')
browser.goto('https://my.bplaced.net/')

usrn = browser.text_field(name="credentials_user")
usrn.value = ''
pswd = browser.text_field(name="credentials_pass")
pswd.value = ''
browser.button(value='Login').click()