# Visual Basic > Visual Basic .NET >  Import Price form web page in a textbox

## nefthi85

Hello Anyone i have a questione , I need to import a specific value from a web page that you can display in a textbox, in particular, the part that interests me is the price that is found after

<div class="item_basic_price">
  3,65 
</div>

is there a way to extract only this data from the page and return it in a textbox?
Thx so much for help

----------


## Shaggy Hiker

The simple answer is, "yes, there is a way." Of course, as is so often the case, the simple answer is more wrong than right.

First off, I assume that the textbox is not, itself, on a web page. It is is, then the whole thread isn't in the right place, and everything else I say will be not quite as correct.

You can parse a web page and extract information from it. Since you have that <div> you have something to focus on. This is called web scraping, and I always discourage it. The problem is that those who maintain web pages have some innate drive to tinker with their pages incessantly. What you would have to do, currently, is find that <div> on the page, which might be easier because it has a class, though that is not an ideal identifier. However, what is a <div> today could be a <p> tomorrow, something else the next day, and something created on the fly by javascript the day after. That means that even if you get the code working to identify the <div> and find the text you want, it will stop working sooner or later, and most likely sooner. Web scraping works best for pages that have largely been abandoned and are no longer being actively updated. That doesn't sound like a description of your situation, so a web scraping solution will fail eventually, and could fail the very day you get it working.

There is a better way, but whether or not it is available to you is hard to say. Web APIs are designed to solve this very problem. If the site you are looking at has an API, then that is what you should use. There is NO advantage of scraping a site that has an API as an alternative. It would be both slower and unreliable at the same time. Unfortunately, not every site puts out APIs. Of course, not every site wants you to scrape their web page, either, and if they don't want you to, then we don't want you to, either. However, the group that put out that page did so as a means to get information to you. They certainly didn't publish a web page to hide from you, which means that there is a fair chance that they will have an API, or that they would be willing to create an API for you if you asked.

That is certainly the first thing to try. If you stick with web scraping, you will just end up pulling your hair out in frustration, and once you run out of hair on your head, that starts becoming extra painful.

----------


## nefthi85

Hello Shaggy thx so  much form your reply , i was  wondering because i not found a metod to make this in an easy way.
I send you a pm of a web site , can you help me about api?

----------

