Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The property 'value' cannot be found on this object. Verify that the property exists and can be set.
- At C:Test.ps1:17 char:1
- + $usernamefield.value = $username
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : InvalidOperation: (:) [], RuntimeException
- + FullyQualifiedErrorId : PropertyAssignmentException
- The property 'value' cannot be found on this object. Verify that the property exists and can be set.
- At C:Test.ps1:20 char:1
- + $passwordfield.value = $password
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- + CategoryInfo : InvalidOperation: (:) [], RuntimeException
- + FullyQualifiedErrorId : PropertyAssignmentException
- Method invocation failed because [System.DBNull] does not contain a method named 'click'.
- At C:Test.ps1:23 char:1
- + $Link.click()
- + ~~~~~~~~~~~~~
- + CategoryInfo : InvalidOperation: (:) [], RuntimeException
- + FullyQualifiedErrorId : MethodNotFound`
- $ie = New-Object -ComObject 'internetExplorer.Application'
- $ie.Visible= $true # Make it visible
- $usernmae="test"
- $password="test1"
- $ie.Navigate("https://website.com/login")
- While ($ie.Busy -eq $true) {Start-Sleep -Seconds 3;}
- $usernamefield = $ie.document.getElementByID('ysi_email')
- $usernamefield.value = $username
- $passwordfield = $ie.document.getElementByID('ysi_password')
- $passwordfield.value = $password
- $Link = $ie.document.getElementByID('ysi_btn_login')
- $Link.click()
- $ie = New-Object -ComObject 'internetExplorer.Application'
- $ie.Visible= $true # Make it visible
- $username="test@toto.fr"
- $password="test1"
- $ie.Navigate("https://To your detailled URL")
- While ($ie.Busy -eq $true) {Start-Sleep -Seconds 3;}
- $usernamefield = $ie.document.getElementByID('ysi_email')
- $usernamefield.value = "$username"
- $passwordfield = $ie.document.getElementByID('ysi_password')
- $passwordfield.value = "$password"
- $Link = $ie.document.getElementByID('ysi_btn_login')
- $Link.click()
- $ie.Quit()
- #Load Selenium to download all URL xml sites
- Add-Type -Path "C:TempWebDriver.dll" # Load the Selenium .Net library
- $env:PATH += ";C:TempUMF_Scraping" # Load the IEDriverServer.exe
- $ie_object = New-Object "OpenQA.Selenium.IE.InternetExplorerDriver" # Instantiate Internet Explorer
- # Using Element ID for this example, but I prefer using The Name element.
- $ie_object.Navigate().GoToURL( "https://website.com/login") # Navigate to login page URL
- $InputUser = $ie_object.FindElementById("ysi_email") # Find the ID element for username input textbox, gt this from the DOM developer Tools search
- $InputUser.SendKeys("usernamegoeshere") # Push the text
- $PasswordUser = $ie_object.FindElementById("ysi_password") # Find the ID element for password input textbox, get this from the DOM developer Tools search
- $PasswordUser.SendKeys("passwordgoeshere") # Push the text
- $LoginButton = $ie_object.FindElementById("ysi_btn_login") # Find the ID element for the submit button, get this from the DOM developer Tools search
- $LoginButton.Click() #Sent click to the submit button
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement