How to upload a resume to a website using selenium in python?

0 votes

Below is the html which is having a “upload a resume” button on a website. I logged in to this website but now wanted to upload a resume using python selenium.

<a href="/resumes/new">upload a resume</a>

Below is the code I tried for clicking the upload a resume button. But it is throwing an error

NoSuchElementException: Message: Unable to locate element: //a[@href="/resumes/new"]

Attach_resume = browser.find_element_by_xpath('//a[@href="/resumes/new"]')

Is there anything that I am missing? I want to click that button and I want to upload a file to it. Please help me out.

Apr 20, 2018 in Selenium by Martin
• 4,210 points
999 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Use this code, this will help you:

from selenium import webdriver

from selenium.webdriver.common.by import By

from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Chrome()

driver.get('https://www.careerbuilder.com')

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@href="/resumes/new"]'))).click()

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'resumeOnComp'))).click()

driver.find_element_by_id('ucResumeUpload_newFileUpload_inputResumeUpload').send_keys('/path/to/file')
answered Apr 20, 2018 by Vardy
• 2,280 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
197 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
135 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
526 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
129 views
+9 votes
13 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,280 points
40,982 views
0 votes
1 answer

Select an item from a dropdown list using Selenium WebDriver

Use this then it will work - new ...READ MORE

answered Apr 9, 2018 in Selenium by Vardy
• 2,280 points
1,083 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.