Python Forum

Full Version: How to click facebook message button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Tried these lines, but did not work. Need help

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as W
from selenium.webdriver.support import expected_conditions as E
from selenium.webdriver.common.keys import Keys
from time import sleep    
import pandas as pd
import re

driver.find_element_by_xpath("//a[@id='u_ps_fetchstream_3_1_5']").click())
driver.find_element_by_link_text('Message')
You're going to need to give more details. What exactly does "did not work" mean? What's happening and what are you expecting to happen? What exactly is your end goal?
You're missing a lot of setup code,
you have to:
  • Start browser
  • fetch url
  • your code goes here
  • close browser