0

Not sure if what I am trying to accomplish is even possible but I figured I'd ask. I have a decent sized spreadsheet with specifications from hundreds of different smartphones that I am working on as sort of a pet project for myself and a tech forum I participate in. One of the columns I have is the "Fan Count" from GSMarena.com as a way of quantifying popularity and interest in the device. (the other two columns to the left are "PhoneArena Staff Rating" and "PhoneArena User Rating".) GSM Arena Fan Count

For now, all I've been doing is entering the amount manually but that can get tedious with so many phones and with how often the number changes. What I'd like to know is if there is any way to automatically pull the "Fan Count" number from the source data of x phone's webpage?

enter image description here

Obviously, I wouldn't be able to have it search for each phone but if I can at at least put the source information for each phone in and have the numbers then update themselves, that would be sufficient.

1
  • Possible = yes. Difficult also = somewhat yes. You will need to use vba without a doubt but there are several methods out there that allow you to download a webpage by url and view the html form of it. Once you have the html, it is simply a matter if dissecting it to find your number
    – Eric F
    Nov 12, 2015 at 19:19

1 Answer 1

1

Here is a good example to get you started. As I stated in my comment, you will need to use VBA to achieve what you want. The basic method is to use VBA to launch internet explorer and then bring back the html code. From within that code you will need to sift through the text to find where your number resides.

Below is a method to return the html for a page:

Sub getData()

Dim url As String
Dim ie As Object
Dim state As Integer
Dim text As Variant


Set ie = CreateObject("InternetExplorer.Application")

ie.Visible = 0

url = "http://www.eoddata.com/stockquote/NASDAQ/AAPL.htm"
ie.Navigate url


state = 0
Do Until state = 4
 DoEvents
 state = ie.readyState
Loop

text = ie.Document.Body.innerHTML

End Sub

Obviously you will change the URL to your website's URL. Once you have this set up the variable text at the end will contain the HTML so use whatever creative method you want to go through that code. You will want to know how to use the MID, FIND, and TRIM commands.

Hopefully this at least gets you started

2
  • Thanks for the information. Looks like I need to start studying VBA.
    – Jacob K
    Nov 12, 2015 at 19:44
  • It really is the only way and isn't too bad to learn. At least you have a good example here to start from.
    – Eric F
    Nov 12, 2015 at 19:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .