Solved Read website content and write to formfield (1 Viewer)

Louisv

Registered User.
Local time
Today, 03:57
Joined
Aug 31, 2018
Messages
21
@arnelgp: error:This property or method is not supported by this object

@ ridders: error:Method Document of object Webbrowser2 has failed

Many Thanks for trying to help me out guys!!

I'm tired, I will go further tomorrow...seem to forget letters in commands (s):confused:
 

Louisv

Registered User.
Local time
Today, 03:57
Joined
Aug 31, 2018
Messages
21
Hi guys,

After setting up a test database and getting data from another "normal" website I get a result but not THE result I like to have.
With the code:

DoCmd.GoToControl "TITLE"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim Header As String
Dim objIE As Object
Dim URL As String
URL = "https://intranetsite.nl/link/standaard/626"
Set objIE = New InternetExplorerMedium
objIE.Visible = True
objIE.Navigate URL
While objIE.Busy = True Or objIE.ReadyState <> 4: DoEvents: Wend
Header = objIE.Document.getElementsByTagName("title")(0).innerText
Forms!Frm_1_Proces!SubFrm_Ref!TITLE = Header

The only problem now is that the TITLE is the title of a INTRANET mainpage instaed of the opened URL page.

The retrieved TITLE is from intranet url mainpage: https://intranetsite.nl/index.html

instead of the page on the screen, the opened URL: https://intranetsite.nl/link/standaard/626

How do I get data from the screenpage?

Any suggestions are highly appreciated:)
 

isladogs

MVP / VIP
Local time
Today, 02:57
Joined
Jan 14, 2017
Messages
18,216
Loius

You've changed from using GetElementByName to GetElementByID (which should work) and now to GetElementByTagName

Similarly you've gone from using IE.Document to New Internet Explorer Medium

I have never heard of let alone used your syntax like your latest code so cannot advise further.

Good luck with your project.
 

Louisv

Registered User.
Local time
Today, 03:57
Joined
Aug 31, 2018
Messages
21
Hi Colin,

Found the code by trial and error using a local test database and another "open" internet page.

The fact why the code would not work is because, after opening the specific page say: https://intranetsite.nl/link/standaard/626
the URL in the URL-bar (at the top of explorer) was not the URL of the opened page but from a sort of mainpage: https://intranetsite.nl/index.html

So any getElements command could only get to the source of the URL https://intranetsite.nl/index.html and not the source of the specific url https://intranetsite.nl/link/standaard/626

Our interanet is developed in mendix perhaps that or because of security issue...

The fact is that the viewed page is another page than the URL in the url-bar.:rolleyes:

Thanks for all your help!!
 

Users who are viewing this thread

Top Bottom