Closed schnalznase closed 1 year ago
Hi, looks like it can't find the post button. IG updated the post array:
Please change this line:
post = browser.find_element_by_xpath('/html/body/div[1]/section/main/div/div[1]/div/div['+str(y)+']/div['+str(x)+']')
to this:
post = browser.find_element_by_xpath('/html/body/div[2]/div/div/div[1]/div/div/div/div[1]/div[1]/div[2]/section/main/div/div[1]/div/div['+str(y)+']/div['+str(x)+']/div/a/div[2]')
And comment if it works.
I changed it by myself. I dont know whether your line does work as well. I am using:
post = browser.find_element_by_xpath(
'/html/body/div[2]/div/div/div/div/div/div/div/div/div[2]/section/main/article/div/div/div/div[' + str(y) + ']/div[' + str(x) + ']')
Still thank you for your help, and the repository :-)
@schnalznase Glad you fixed it.
Error on likeAndComm-function Line 34/35:
I get an error, on line 34/35, where the bot, shall find the posts on the explore-page: my console says:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/section/main/div/div[1]/div[1]/div[1]"} (Session info: chrome=111.0.5563.65) Process finished with exit code 1
Could you update the line?
Line 34 / 35
post = browser.find_element_by_xpath( '/html/body/div[1]/section/main/div/div[1]/div/div[' + str(y) + ']/div[' + str(x) + ']')