Web scraper for access db (1 Viewer)

Vulpeccula

New member
Local time
Today, 20:47
Joined
Sep 5, 2020
Messages
23
Hi guys,
I'm currently developing a household budgeting application which I initially started for my own use. However, it has attracted a great deal of interest from friends and associates who think it's rather neat. Apart from the usual fixed costs such as mortgage, local taxes, telecoms etc, the biggest controllable weekly outlay is the family grocery shopping bill, so I have incorporated a shopping app which allows the user to select a retailer and bring up their product list. Then as they select a product from a listbox of "Available Products" the item is moved to a listbox called "Selected Products". Eezy peezy lemon squeezy right? So whats the problem? Ok, in it's current iteration, I have populated my supplier/products tables (and all associated prices) by making a list of requirements then researching the prices via the retailers' own website. What I would like to incorporate is a web scraper that imports all the products, sizes and prices directly into the database tables. Do any of you incredibly talented people have any ideas on how I might achieve this goal? I have some (seriously limited) experience of xml but real simple is real good in my case. Thank you in advance, all suggestions gratefully received.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:47
Joined
May 7, 2009
Messages
19,169
on the basics, you need to get hold of the InnerText of the html.
loop though the Text, finding a particular <Tag>.
 

Vulpeccula

New member
Local time
Today, 20:47
Joined
Sep 5, 2020
Messages
23
on the basics, you need to get hold of the InnerText of the html.
loop though the Text, finding a particular <Tag>.
Hi friend, wow! that was a rapid response.Thank you.
I have done a little research on how to "wrap" the xml in VBA but most case studies I have found seem specific to Excel. I understand that if I locate the appropriate H3 tag it should expose the A tag and give an inroad to products and prices but I guess what I really need is some example code. If you could help with that I would be very grateful.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:47
Joined
May 7, 2009
Messages
19,169
im out of my Time zone right now.
if you can post the URL of which site to scrape, then we
can try extracting the info for you and thereby give you a real
sample db.

or if you already have a sample txt (xml/html) then
it would be great.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:47
Joined
May 7, 2009
Messages
19,169
i made a sample scraping sometime ago for an OP.
on the sample form, select an item on the combo.
wait until "Show Result" command button is Enabled.
when it got enabled, click it to view the result.

view the code-behind the button.
 

Attachments

  • webScrape.zip
    24.3 KB · Views: 153

Isaac

Lifelong Learner
Local time
Today, 13:47
Joined
Mar 14, 2017
Messages
8,738
I think you will find that a LOT of research is required to figure out what html and elements are on each grocery site's site.....and then there will be multiple pages.....and then those pages will change all the time (companies tend to design and re-design webpages constantly). I don't think this is a good use case for a webscrape. But nothing wrong with trying. You will come to some conclusion after you start digging a while, either it's doable or it's not. The most common way to find elements on a page is GetElementByID. More discussion on that here and here
 

Users who are viewing this thread

Top Bottom