Example Code

Rip text from a website into a string indicator on a Front Panel

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example demonstrates extracting text from a webpage.

 

Description

Starting with a WebBrowser ActiveX control, invoke and property nodes are used to navigate to a URL and extract the text from the webpage.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Type the URL of a webpage into the URL text control, such as " http://www.google.com ".
  2. Run the VI.

 

Additional Information or References

 

Front Panel snippet2.PNG

 

VI Snippet

1.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.** 

Dan Richards
Certified LabVIEW Developer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Todd S.
NI Employee (retired)
on

This is a great VI!  I've been trying to migrate some online spreadsheets into LabVIEW for analysis, and until now I've had to copy every page into Excel or notepad first!  This is going to save me the longest, most manual step of the whole process.  Thanks!!!

Todd S.
LabVIEW Community Manager
National Instruments
RTSLVU
Trusted Enthusiast
Trusted Enthusiast
on

Looks simmilar to the example here: http://zone.ni.com/devzone/cda/epd/p/id/2743

That works great and I have been using for a while now to test POE devices that have a status webpage.

But I don't have LV 8.6 so I can't really compare them...

========================
=== Engineer Ambiguously ===
========================
RoyA
Member
Member
on

Is there any way to interact with the resulting page?  I want to extract text from a bank account.  Need to be able to login to account first, go to account page, then rip text.

crelf
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

You can rip images from webpages too: https://lavag.org/topic/4319-displaying-images-from-a-webpage/





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

I use datasocket read to extract the html source from URL addresses. Far simpler:

datasocket.png

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Marian_O
Active Participant
Active Participant
on

Kudos to Thoric!

Marian Vorderer
pallen
Active Participant
Active Participant
on

Just went looking for this and couldn't find it.  Any idea where this post got to?

---------------------
Patrick Allen: FunctionalityUnlimited.ca
BalajiB
Member
Member
on

thank u very much

very useful