2

I am trying to data scrape LinkedIn page. I successfully sign in, input search value to inputbox, but after cannot send key enter. Code is below. I think there was something like for enter sendkeys. "~". Whats is interesting why the code like webdriver.sendkeys("inputvalue",keys.enter) gives an error?

Sub LinkdNIn_SlnIUM_login()

Dim webdriber As WebDriver
    Set webdriber = New ChromeDriver
    Const URL = "https://www.linkedin.com/"
    
    webdriber.Start "chrome", URL
    webdriber.Get "/"
    webdriber.Wait 3000
    
    On Error Resume Next
Dim a As WebElements
    Set a = webdriber.FindElementsByClass("authwall-join-form__form-toggle--bottom")
    a.Item(1).Click

    Set a = webdriber.FindElementsById("session_key")
    a.First.Click
    a.First.SendKeys Worksheets(1).Range("I6").Value
    
    webdriber.Wait 3000
    Set a = webdriber.FindElementsById("session_password")
    a.Item(1).Click
    webdriber.Wait 3000
    a.First.SendKeys Worksheets(1).Range("I7").Value
    webdriber.Wait 3000
    Set a = webdriber.FindElementsByClass("sign-in-form__submit-button")
    a.Item(1).Click
    webdriber.Wait 3000
    Set a = webdriber.FindElementsByClass("secondary-action")
    a.Item(1).Click
    webdriber.Wait 3000
    Set a = webdriber.FindElementsByClass("search-global-typeahead__collapsed-search-button")
    a.Item(1).Click
    webdriber.Wait 3000
    Set a = webdriber.FindElementsByClass("search-global-typeahead__input")
    a.Item(1).Click
    webdriber.Wait 3000
    a.Item(1).SendKeys ("data analyst in jobs")
    a.Item(1).SendKeys Keys.Enter ' error object is required
End Sub

I tried with no result;

a.Item(1).SendKeys ("data analyst in jobs")
webdriber.Wait 3000
a.Item(1).SendKeys "{ENTER}"

1 Answer 1

2

try

a.Item(1).SendKeys ("data analyst in jobs" & vbCrLf)
Sign up to request clarification or add additional context in comments.

Comments

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.