ImportXML from PHP Website

sprigelz

Board Regular
Joined
Jan 7, 2016
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Good day excel geniuses!

I am trying to write a formula, which I believe would be written with ImportXML, to pull info from a website.

Link to source website here.

The info that I want to scrape from the site is the H3, H4 class='price', and p class='small' for each item listed.
<div class="card-wrapper"><h3>Accu-Chek Aviva Plus</h3>
<img src='[URL]https://www.diabeticstrips4cash.com/2/images-comp/Aviva-50-min.jpg[/URL]' alt='sell unused Accu-Chek Aviva Plus strips' class='img-fluid icon'>
<h4 class='price'>$30</h4>
<p class='small'>Retail Qty. 50 </p></div></div>

In Excel I would want it to look as such;
NamePriceAmount
Accu-Check Aviva Plus$30Retail Qty. 50

I'm having trouble just getting any basic information to import to Excel. Anyone able to help me with this?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
<div class="card-wrapper"><h3>Accu-Chek Aviva Plus</h3>
<img src='[URL]https://www.diabeticstrips4cash.com/2/images-comp/Aviva-50-min.jpg[/URL]' alt='sell unused Accu-Chek Aviva Plus strips' class='img-fluid icon'>
<h4 class='price'>$30</h4>
<p class='small'>Retail Qty. 50 </p></div></div>
there is nothing like you show except
accu.png
 
Upvote 0
Good evening Sandy,

Thanks for your response. Scroll down to the "What We Buy" section, or click here. Sorry for the confusion.

The above code was pulled from the HTML. Right click the webpage and click Inspect.
 
Upvote 0
I was able to solve this by utilizing the following formula.

Source link: here

A1 = Link above
B1 = =importxml(A1,"/html/body/div[5]/div[2]")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,630
Messages
6,120,634
Members
448,973
Latest member
ChristineC

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