+ Reply to Thread
Results 1 to 12 of 12

Import Data from a website consistently

  1. #1
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Import Data from a website consistently

    Hello excel and VBAīs masters....

    This is my first post, so Iīm Edaurdo from Portugal and Iīm a noob with VBA coding.... I downloaded some tutorials from the " Excel Useful Links ", but I need some help quickly (if you have the time)..... I would thank you, in advance, for any help you could give me.....

    So, the problem is this:

    - I already try with excel (data-from web-select the box(es)-OK), and I extract the data (table) that I need. So far, so good....

    - Later (about 3-4 days), when I do the refresh the tables are all wrong. Then I go to the connections links and the box(es) previously selected desapear or other box(es) are selected.

    So I donīt know what I do wrong or it just donīt work like this.

    The site is www.soccerstats.com (do you know??)....

    I would like to import the data from some tables, but I donīt know if I do direct from excel or from VBA code.....


    Many thanks, in advance, for any help you could do.....

    Best regards,
    Eduardo

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Import Data from a website consistently

    would be better if you can provide example of your file

    i can extract the table without issue but dont know where the issue lies or how it differs from older tables?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    Hello, sorry the wait.... But in work I donīt have the possibility to upload files.....

    http://speedy.sh/TkVRR/Connections-Lost.xlsx

    The link is here, to download the file to see what Iīm talhing about.

    If you can help me to not to loose the connections, I would thank you very much.....

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Import Data from a website consistently

    ok i see your file arsenal fan i take it

    it seems to update as intended
    i went and deleted all the data and ran refresh and it is exactly same as website

    what exactly is "wrong", there was no connection issues?

  5. #5
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    Here the original file.....

    http://speedy.sh/QE2GZ/Premier-League.xlsm

    When you hit the refresh button, you gonna see what happens to the team tables......

    Thatīs what Iīm talking about..... The macro button, is to convert . to , (I recorded the moviments - macro).....

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Import Data from a website consistently

    ok your macro does not have anything to do with the issue

    Firstly
    you have linked on your connection list - ligacao 3 -
    http://www.soccerstats.com/latest.asp?league=spain
    i think if you fix that it would stop a lot of the issue with bad info

    secondly
    the website has taken away the ability to import the table - GOALS BY HALF (overall)
    although you can still refresh, you cant edit or amend it

    so i cant fix it completely

    what it imports now is GOALS PER 15 MIN. (overall)
    Last edited by humdingaling; 11-12-2013 at 08:35 PM.

  7. #7
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    Thank you for your quickly reply.....

    About the connection 3 (ligacao 3), youīre correct.... This connection imports the spanish league stands..... I fixed already......

    About the table Goals By Half, I think only with VBA code could fix this.... But like I said, VBA code for me is like cooking (donīt know anything)....

    I donīt know if itīs difficult to make this kind of code, but if you (or anyone) could help with this, I would be very appreciate. Maybe for just one team, then I could start to play to make the rest of the teams.....

    It would be 1st VBA lesson .....

    Besides this, thank you very much for your help.....

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Import Data from a website consistently

    ok i did some research on site
    they have moved GOALS per HALF OVERALL into different page
    http://www.soccerstats.com/timing.asp?league=england
    (about half way down the screen)

    from there you could import into different section of the sheet and then have formulas drive the update

    sorry to say you are going to have to re-code all your connections again because the website changed its format
    you wont need VBA to accomplish this, i would do it for you but it is labour intense and fiddly but if you can do all the connections fixed first i can help you encode the formula if you need help for that

  9. #9
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    Hello again.....

    Thank you for your help. I did the reconnections already and it workīs fine....

    But I have another doubt.....

    In the image below, can I import the data of the 3 arrows (Overall/Home/Away)???? Because when I select the Home tab or Away tab, the link didnīt change. So when I import the data, the only thing that appears is the Overall stats.

    \1

    With this table I know the % of the scored and concedeed goals by each team....

    Hereīs the link page: http://www.soccerstats.com/trends.asp?league=england

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Import Data from a website consistently

    i thought you were after goals by halves, which is right down the bottom of this screen
    http://www.soccerstats.com/timing.asp?league=england

    the trends page is something different altogether
    i found with this site that when they have tabs like that it doesnt let you take data download into excel easily

  11. #11
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    The goals by halves is ok now.....

    The other table with tab, I thought it would be more difficult..... When we select the Home tab or the Away tab, the link still the same. So the only data that import is the Overall tab.....

    Maybe only with code.....

    In this site (http://fcstats.com/statistics,portug...tugal,30,4.php) is php... The boxes wonīt show when I connect to excel....

    But to put that table into a VBA code is easy??? Or itīs just difficult as the other site???

    This excel file is to automate the whole process of selecting teams by criteria (Goals for, against, 1 half, 2 half, etc.).....

  12. #12
    Registered User
    Join Date
    11-11-2013
    Location
    Portgal
    MS-Off Ver
    Excel 2016
    Posts
    47

    Re: Import Data from a website consistently

    Hello everyone.... i did the VBA code already for this. Recorded a macro, then copied the code..... I made a button that, when pushed, he extract me the data.....

    But I have one little problem, if I hit the button 2 times, more tables appears.... I donīt want that..... The data must overwrite the past data.....

    I donīt know if you understand this.... The code is this:

    Please Login or Register  to view this content.

    Need some help with this issue........
    Last edited by arlu1201; 12-19-2013 at 10:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. import data from a website
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2012, 06:39 PM
  2. [SOLVED] import data from website
    By Cicada in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2012, 05:34 PM
  3. Import Data from a Website
    By mrsrinivas1988 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2011, 07:14 AM
  4. Trying to import data from website to Excel
    By stronz in forum Excel General
    Replies: 1
    Last Post: 01-13-2011, 11:27 PM
  5. import excel data to website
    By robster52 in forum Excel General
    Replies: 0
    Last Post: 05-24-2010, 05:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1