0

1

https://iphone.facebook.com/marketplace/selling/item/

base on image that i've upload, i have to fill some column and click few button to post product. i still try to create selenium bot automation to do it but i have problem on clicking the button element like, post button, category (not button but i have to click it to show its option) and last one is location (not button to but have to click it to show the column).

i have csv file as source of data, and i write code below to fill data ;

        scraper.element_send_keys('input[name="title"]', data['Title'])
    scraper.element_send_keys('input[name="price"]', data['Price'])
    scraper.element_send_keys('textarea[name="description"]', data['Description'])

what i need now is click on post button and fill the location and category with data from csv file.

sorry for my bad english but i need help.

Thank you.

I have try using xpath, id and name tag to locate the element for click but not work.

i want code that can click on button and column that i mention above.

1 Answer 1

1

I think, you should use .keys to click on the post button, and using the id is a good idea.

from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By

driver.impicitly_wait(4) 
post_button = driver.find_element(By.ID, 'u_0_25_2e')
post_button.send_keys(Keys.'RETURN')

or 
post_button = driver.find_element(By.ID, 'u_0_27_ty')
post_button.send_keys(Keys.'RETURN')

you can open try, except block or use driver.wait until expected conditions.

Hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

can you help me with location and category column ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.