Skip to main content
added 2 characters in body
Source Link
Andersson
  • 52.8k
  • 18
  • 83
  • 133

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable((By.XPATH, '//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(By.XPATH, '//a[starts-with(@href, "list.asp?Table=List")]'))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable((By.XPATH, '//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds
added 3 characters in body
Source Link

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(xpath(By.XPATH, '//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(xpath('//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(By.XPATH, '//a[starts-with(@href, "list.asp?Table=List")]'))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds
added 88 characters in body
Source Link

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(xpath('//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(xpath('//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

It looks like you never actually use the implicit wait. This is how I would write script with an explicit wait.

def ct_content(url):
    browser = webdriver.PhantomJS()
    browser.get(url)
    wait = WebDriverWait(browser, 10)
    try:
        content = wait.until(EC.element_to_be_clicable(xpath('//a[starts-with(@href, "list.asp?Table=List")]')))
        browser.quit()
        return content.text
    except:
        browser.quit()
        return False

Also, the way to set implicit waits is:

browser.implicitly_wait(10) # seconds
added 1 character in body
Source Link
Loading
added 1 character in body
Source Link
Loading
Source Link
Loading