mardi 1 septembre 2015

Using VBA (Excel 365) to parse google search results

I am attempting to use VBA within Excel to return (from a list of search terms) the first result provided by Google.

Whilst the example at Using VBA in Excel to Google Search in IE and return the hyperlink of the first result, works perfectly, I cannot for the life of me understand why.

If we assume that we are looking for the search term 'Abingdon', this word appears nowhere within the source code for the results page for 'Abingdon' returned by Google. Neither are any of the element/tagIDs used to locate it within the above code (e.g. H3, rso, etc. etc. etc.)

Assuming this to be the case, I fail to see how searching for a term can return the correct answer (i.e. the first link) as neither the search term (nor the link) is located where the macro is (seemingly) looking (e.g. the page source).

Any help much appreciated!




Aucun commentaire:

Enregistrer un commentaire