I have been trying to find a sample of this on the internet and i cannot.
Scenario: I have an Oracle program, it has a logon screen with username and password, 2nd screen i need to enter a "1" to get to the screen i am looking for.
From there, i just want to scrape all or some of the information from that screen into my Access. I won't get access to the tables directly otherwise that is the route i would have taken.
Can anyone help or point me to a tutorial on this type of stuff?
Thanks, Much appreciated.
Ashe
3 8308 NeoPa 32,556
Expert Mod 16PB
It appears to me that screen scraping is a facility not native either to Access or VBA. As such I don't feel this is the right place for this question.
Here is some VBA code that will grab an open IE Browser window on your desktop and return the document so that it can be scraped. Use the Tagnames and Innertext fields. You will need to handle frames on the page specially.
This should get you going -
Sub TstdcIEURL()
-
Dim myObj As Object, ObjDoc As Object
-
Dim myTagName As String, myInnerText As String
-
'Set myObj = dcIEURL("replace with desired IE domain name", "optional parameter, replace with Location name")
-
Set ObjDoc = myObj.Document
-
For i = 1 To ObjDoc.all.length
-
myTagName = ObjDoc.all.Item(i).tagName
-
myInnerText = ObjDoc.all.Item(i).innerText
-
Debug.Print myTagName, myInnerText
-
Stop
-
Next i
-
Stop
-
End Sub
-
Public Function dcIEURL(zDomainName, Optional zLocName As String) As Object
-
'zDomainName is the IE window with data you want to screen scrape, LocName is optional and a further qualification of the window data
-
On Error GoTo ErrHandler
-
Dim objShellWins As SHDocVw.ShellWindows
-
Dim ObjIE As SHDocVw.InternetExplorer
-
Dim ObjDoc As Object
-
Dim myInnerText As String
-
Dim myNode As String, AccountID As String
-
Dim i As Integer, myLeft As String, myRight As String
-
Dim strOut As String, mySearch As String
-
Dim intFree As Integer, myURL As String
-
Dim myURLDomainInspecting As String, myURLDomainSeeking As String
-
Dim myLocNameInspecting As String, myLocNameSeeking As String
-
Dim myIE As Variant
-
-
-
' Instantiate
-
Set objShellWins = New SHDocVw.ShellWindows
-
' There might be multiple IE windows open
-
If objShellWins.Count > 0 Then
-
myURLDomainSeeking = zDomainName
-
If IsMissing(zLocName) Then
-
myLocNameSeeking = ""
-
Else
-
myLocNameSeeking = zLocName
-
End If
-
For Each ObjIE In objShellWins
-
With ObjIE
-
' Try to locate the browser with a specific address in it's AddressBar.
-
myURLDomainInspecting = GetDomain(.LocationURL)
-
myLocNameInspecting = ObjIE.LocationName
-
Select Case myURLDomainInspecting
-
Case Is = myURLDomainSeeking 'Domains are equal here
-
' URL points to one passed to this function
-
If myLocNameSeeking <> "" Then 'Bypass if no loc name to find
-
Select Case myLocNameInspecting
-
Case Is = "" 'LocName not present, use URL
-
Set myIE = ObjIE
-
Exit For
-
Case Is = myLocNameSeeking
-
Set myIE = ObjIE
-
Exit For
-
End Select
-
Else
-
Set myIE = ObjIE
-
Exit For
-
End If
-
Case Else
-
If Left(myURLDomainSeeking, 6) = "rodweb" Then
-
If Left(myURLDomainInspecting, 6) = "rodweb" Then
-
Set myIE = ObjIE
-
Exit For
-
End If
-
End If
-
End Select
-
End With
-
Next
-
End If
-
If IsObject(myIE) = False Then
-
Set myIE = CreateObject("InternetExplorer.Application")
-
myIE.Width = 1200
-
myIE.Height = WinHeight
-
myIE.Left = 1
-
myIE.Top = 1
-
myIE.Visible = True
-
End If
-
Set dcIEURL = myIE
-
ExitHere:
-
On Error Resume Next
-
Close #intFree
-
Set ObjDoc = Nothing
-
Set ObjIE = Nothing
-
Set objShellWins = Nothing
-
Exit Function
-
ErrHandler:
-
With Err
-
MsgBox "Error: " & .Number & vbCrLf & .Description, _
-
vbCritical Or vbOKOnly, .Source
-
End With
-
Resume ExitHere
-
-
End Function
-
Sub TstdcIEURL()
-
Dim myObj As Object, ObjDoc As Object
-
Dim myTagName As String, myInnerText As String
-
'Set myObj = dcIEURL("replace with desired IE domain name", "optional parameter, replace with Location name")
-
Set myObj = dcIEURL("ecf.nceb.uscourts.gov")
-
Set ObjDoc = myObj.Document
-
For i = 1 To ObjDoc.all.length
-
myTagName = ObjDoc.all.Item(i).tagName
-
myInnerText = ObjDoc.all.Item(i).innerText
-
Debug.Print myTagName, myInnerText
-
Stop
-
Next i
-
Stop
-
End Sub
-
Public Function dcIEURL(zDomainName, Optional zLocName As String) As Object
-
'zDomainName is the IE window with data you want to screen scrape, LocName is optional and a further qualification of the window data
-
On Error GoTo ErrHandler
-
Dim objShellWins As SHDocVw.ShellWindows
-
Dim ObjIE As SHDocVw.InternetExplorer
-
Dim ObjDoc As Object
-
Dim myInnerText As String
-
Dim myNode As String, AccountID As String
-
Dim i As Integer, myLeft As String, myRight As String
-
Dim strOut As String, mySearch As String
-
Dim intFree As Integer, myURL As String
-
Dim myURLDomainInspecting As String, myURLDomainSeeking As String
-
Dim myLocNameInspecting As String, myLocNameSeeking As String
-
Dim myIE As Variant
-
-
-
' Instantiate
-
Set objShellWins = New SHDocVw.ShellWindows
-
' There might be multiple IE windows open
-
If objShellWins.Count > 0 Then
-
myURLDomainSeeking = zDomainName
-
If IsMissing(zLocName) Then
-
myLocNameSeeking = ""
-
Else
-
myLocNameSeeking = zLocName
-
End If
-
For Each ObjIE In objShellWins
-
With ObjIE
-
' Try to locate the browser with a specific address in it's AddressBar.
-
myURLDomainInspecting = GetDomain(.LocationURL)
-
myLocNameInspecting = ObjIE.LocationName
-
Select Case myURLDomainInspecting
-
Case Is = myURLDomainSeeking 'Domains are equal here
-
' URL points to one passed to this function
-
If myLocNameSeeking <> "" Then 'Bypass if no loc name to find
-
Select Case myLocNameInspecting
-
Case Is = "" 'LocName not present, use URL
-
Set myIE = ObjIE
-
Exit For
-
Case Is = myLocNameSeeking
-
Set myIE = ObjIE
-
Exit For
-
End Select
-
Else
-
Set myIE = ObjIE
-
Exit For
-
End If
-
Case Else
-
If Left(myURLDomainSeeking, 6) = "rodweb" Then
-
If Left(myURLDomainInspecting, 6) = "rodweb" Then
-
Set myIE = ObjIE
-
Exit For
-
End If
-
End If
-
End Select
-
End With
-
Next
-
End If
-
If IsObject(myIE) = False Then
-
Set myIE = CreateObject("InternetExplorer.Application")
-
myIE.Width = 1200
-
myIE.Height = WinHeight
-
myIE.Left = 1
-
myIE.Top = 1
-
myIE.Visible = True
-
End If
-
Set dcIEURL = myIE
-
ExitHere:
-
On Error Resume Next
-
Close #intFree
-
Set ObjDoc = Nothing
-
Set ObjIE = Nothing
-
Set objShellWins = Nothing
-
Exit Function
-
ErrHandler:
-
With Err
-
MsgBox "Error: " & .Number & vbCrLf & .Description, _
-
vbCritical Or vbOKOnly, .Source
-
End With
-
Resume ExitHere
-
-
End Function
-
You can just as easily get this information from copying and pasting the open browser window.
Screen scraping is generally frowned upon since you are using another companies data for your own purposes. As long as you are using it for academic purposes then it shouldn't be a problem.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jonathan Epstein |
last post by:
I would like to perform a more classical type of "screen scraping"
than what most people now associate with this term. I only want to
find all the text on the current screen, and obtain associated...
|
by: Roland Hall |
last post by:
Am I correct in assuming screen scraping is just the response text sent to
the browser? If so, would that mean that this could not be screen scraped?
function moi() {
var tag = '<a href=';
var...
|
by: Me |
last post by:
I am dealing with a poorly written windows application that does not contain
an API.
I would like to use C# to run a predetermied set of steps in the application
and scrape the resulting data...
|
by: Robert Martinez |
last post by:
I've seen a lot about screen scraping with .NET, mostly in VB.net. I have
been able to convert most of it over, but it is still just very basic stuff.
Can someone help direct me toward some good...
|
by: _eee_ |
last post by:
Does anyone know of a simple code module that can do screen scraping,
including simulating user-entered pushbuttons, etc.
I can get the first screen on a website with HttpWebRequest, but I
need...
|
by: Jim Giblin |
last post by:
I need to scrape specific information from another website, specifically the
prices of precious metals from several different vendors. While I will
credit the vendors as the data source, I do not...
|
by: niv |
last post by:
Hello,
I would like to screen scrape certain parts of a
webpage...how can I do this in asp.net
For instance.... a stockticker thats embeded on a
webpage.. I dont want the entire page.. I...
|
by: rachel |
last post by:
Hello,
I am currently contracted out by a real estate agent. He
has a page that he has created himself that has a list of
homes.. their images and data in html format.
He wants me to take...
|
by: different.engine |
last post by:
Folks:
I am screen scraping a large volume of data from Yahoo Finance each
evening, and parsing with Beautiful Soup.
I was wondering if anyone could give me some pointers on how to make
it...
|
by: WFDGW2 |
last post by:
I want to write or obtain C++ code that will scrape text from a dialog
box within a poker client, and then record that text somewhere else.
What do I do? Thanks.
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |