UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Get Information From Intermet And Put In A Table, Access 2016    
 
   
waalw
post Apr 16 2017, 04:12 AM
Post#1



Posts: 3
Joined: 14-April 17



I found several posts on this topic but I cant get the correct information I need. I want to import the top 40 (https://www.top40.nl/top40/2017/week-14) and then the fields artist, song, position, week and year,

I manage to get the internet page in the memory but then I neet to extract the fields mentioned above and this is where I strand. I tried to find a logic in the page code but I am no expert in HTML. Can anyone please help me complete thise code below???


Dim ie As InternetExplorer
Dim html As HTMLDocument
Set ie = New InternetExplorer
ie.Visible = False
ie.navigate "https://www.top40.nl/top40/2017/week-14"

Do While ie.readyState <> READYSTATE_COMPLETE
DoEvents
Loop
Go to the top of the page
 
zocker
post Apr 16 2017, 05:04 AM
Post#2


Utterly Eccentric and Moderator
Posts: 4,047
Joined: 4-March 00
From: Bristol / Ipswich / Spain


Greetings and welcome2UA.gif

I suggest you have a look at iMacros Which I believe does what you want. Its a freebie!

All the best,

Zocker

--------------------
Everything in moderation.......especially moderation.
Go to the top of the page
 
DanielPineault
post Apr 16 2017, 07:28 AM
Post#3


UtterAccess VIP
Posts: 5,022
Joined: 30-June 11



You'd need to isolate the <ol class=top40>...</ol>
and then iterate over the <li ...> elements one by one, each representing a song and extract the <div class="title-credit text-center>...</div>" to get the artist and title.
The week and year you can simply extract right from the URL.
Attached File(s)
Attached File  4_16_2017_8_25_59_AM.jpg ( 170.15K )Number of downloads: 9
 

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this".
* A user interface is like a joke, if you have to explain it, it's not that good!


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...
Go to the top of the page
 
waalw
post Apr 18 2017, 10:22 AM
Post#4



Posts: 3
Joined: 14-April 17



thanks for the tip, but how do it put this in code? with the code below in found all the entries, but what then??

Dimm tags As Object
Set tags = IE.Document.getElementsByTagName("*")

For Each tag In tags
If tag.className = "top40" Then
MsgBox tag.innerText
end if
This post has been edited by waalw: Apr 18 2017, 10:23 AM
Go to the top of the page
 
waalw
post Apr 18 2017, 10:22 AM
Post#5



Posts: 3
Joined: 14-April 17



thanks for the tip, but how do it put this in code? with the code below in found all the entries, but what then??

Dimm tags As Object
Set tags = IE.Document.getElementsByTagName("*")

For Each tag In tags
If tag.className = "top40" Then
MsgBox tag.innerText
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    24th July 2017 - 05:27 AM