P
programmervb.net
Guest
hello
how get html source code chrome vb.net
i have code
This code get title
I'm want to get the source code
Is there a way or solution to get the source code from
chrome
'//Grab all the Chrome processes
Dim chrome() As Process = Process.GetProcessesByName("chrome")
'//Exit if chrome isn't running
If chrome.Length <= 0 Then Exit Sub
For Each chromeProcess As Process In chrome
'//If the chrome process doesn't have a window handle then ignore it
If chromeProcess.MainWindowHandle <> IntPtr.Zero Then
'//To find the tabs we first need to locate something reliable - the 'New Tab' button
Dim rootElement As AutomationElement = AutomationElement.FromHandle(chromeProcess.MainWindowHandle)
Dim condNewTab As Condition = New PropertyCondition(AutomationElement.NameProperty, "New Tab")
Dim elemNewTab As AutomationElement = rootElement.FindFirst(TreeScope.Descendants, condNewTab)
'//Get the tabstrip by getting the parent of the 'new tab' button
Dim tWalker As TreeWalker = TreeWalker.ControlViewWalker
Dim elemTabStrip As AutomationElement = tWalker.GetParent(elemNewTab)
'//Loop through all the tabs and get the names which is the page title
Dim tabItemCondition As Condition = New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TabItem)
For Each tabItem As AutomationElement In elemTabStrip.FindAll(TreeScope.Children, tabItemCondition)
Dim HTML As New mshtml.HTMLDocument
MsgBox(tabItem.Current.Name)
Next
End If
Next
Continue reading...
how get html source code chrome vb.net
i have code
This code get title
I'm want to get the source code
Is there a way or solution to get the source code from
chrome
'//Grab all the Chrome processes
Dim chrome() As Process = Process.GetProcessesByName("chrome")
'//Exit if chrome isn't running
If chrome.Length <= 0 Then Exit Sub
For Each chromeProcess As Process In chrome
'//If the chrome process doesn't have a window handle then ignore it
If chromeProcess.MainWindowHandle <> IntPtr.Zero Then
'//To find the tabs we first need to locate something reliable - the 'New Tab' button
Dim rootElement As AutomationElement = AutomationElement.FromHandle(chromeProcess.MainWindowHandle)
Dim condNewTab As Condition = New PropertyCondition(AutomationElement.NameProperty, "New Tab")
Dim elemNewTab As AutomationElement = rootElement.FindFirst(TreeScope.Descendants, condNewTab)
'//Get the tabstrip by getting the parent of the 'new tab' button
Dim tWalker As TreeWalker = TreeWalker.ControlViewWalker
Dim elemTabStrip As AutomationElement = tWalker.GetParent(elemNewTab)
'//Loop through all the tabs and get the names which is the page title
Dim tabItemCondition As Condition = New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TabItem)
For Each tabItem As AutomationElement In elemTabStrip.FindAll(TreeScope.Children, tabItemCondition)
Dim HTML As New mshtml.HTMLDocument
MsgBox(tabItem.Current.Name)
Next
End If
Next
Continue reading...