Finding and copying specific text from a website, using a URL.

JayBurn

New Member
Joined
Jun 13, 2013
Messages
44
Afternoon Mr Excel and Co.

I have been given a spreadsheet with a list of nearly 800 URLs. Each of the URLs is for a specific product.
I have not however been given the product codes, and the URL does not include the product code at all, nor does it give any identifying hints...

So, my question, is there a way to use a Web Query to effectively pull the product code from the website? There is a very specific bit of text before the code, but the websites are not in a table format.

I've been trying to get my head around getting Excel to effectively open the source code of the URL, find the specific text, then copy the following X number of characters, and paste it into Excel.

Is it possible, or do I need to get someone to load every single page and copy the code manually?

Thanks,

Jay
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Are the URLs all for the same website? If the website doesn't use HTML tables then a web query which imports the entire page to a separate sheet might work. The VBA code then looks for the specific text and copies the product code to the master sheet. If a web query doesn't work then look at IE automation or XMLhttp requests.
 
Upvote 0
Are the URLs all for the same website? If the website doesn't use HTML tables then a web query which imports the entire page to a separate sheet might work. The VBA code then looks for the specific text and copies the product code to the master sheet. If a web query doesn't work then look at IE automation or XMLhttp requests.

They're all on the same website, but different pages. I've been trying to get a web query to work for it, but it is only pulling in a very small portion of the page, not including the part I need. Using IE automation, I'd have to go to each page individually, which is what I'm trying to avoid doing.
I've not used XMLhttprequests before, I'll do some reading and see if it would help. Is there a way to build XMLhttprequests into Excel?
 
Upvote 0
I have noticed that the pages have the product code in the page title too, is there a VBA method to query a webpage title without having to load the enitre page through web query?
 
Upvote 0
Yes, but we'd need to see the source code for the page really. Ideally though a url we can access
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top