0

I've used Selenium a handful of times and never had any problems though admittedly it has been a little over a year since I last tested it.

I tried running the following:

def time_sleep(sec, times_random):
    seconds = sec + (random.random() * times_random)
    return time.sleep(seconds)

def navigate_website(website_name):
    browser.get(website_name)
    time_sleep(1, 3)
    
def fill_field(x_path, text):
    element = browser.find_element_by_xpath(x_path)
    time_sleep(1, 1)
    element.send_keys(text)    

if __name__ == "__main__":
    browser = webdriver.Chrome()
    navigate_website('https://www.prc.gov/dockets/search')
    time_sleep(1, 3)
    fill_field('//*[@id="TitleContains"]', 'some text')

When I got the subsequent error after running send_keys():

WebDriverException: Message: unknown error: call function result missing 'value'
  (Session info: chrome=86.0.4240.111)
  (Driver info: chromedriver=2.25.426935 (820a95b0b81d33e42712f9198c215f703412e1a1),platform=Mac OS X 10.14.6 x86_64)

I downloaded the version of chromedriver for Chrome 86.x and tried updating Chrome to the latest version (it says 86.x is up-to-date). Is there something I'm missing?

otteheng
  • 594
  • 1
  • 9
  • 27
  • https://stackoverflow.com/a/49528998/1387701 might help. – DMart Oct 28 '20 at 01:12
  • @DMart I've looked at that. It basically just tells me to update Chrome or the Webdriver, which I believe I've done but it doesn't hurt to check again. – otteheng Oct 28 '20 at 12:50

1 Answers1

0

Turns out the solution was fairly easy. I just needed to move the updated chromedriver to the appropriate path. Originally I thought it was enough to have the driver in my project path but selenium kept calling the version found in /usr/local/bin.

Solution:

  1. Download Chromedriver and unzip file.

  2. Open terminal and type mv chromedriver /usr/local/bin

otteheng
  • 594
  • 1
  • 9
  • 27