Grabbing text from website
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts
Page 1 of 1
hey guys, id like to know a probably a snippet or a tutorial on how to grab text from a website in visual basic..
An example of a program will be something like a plagarism checker maybe.
thanks in advanced
An example of a program will be something like a plagarism checker maybe.
thanks in advanced
If you're using a Webbrowser control you can grab the content of elements on a webpage like this:
Code: Select all
Where "ID-of-the-element" would be the ID tag of whichever element you want to pull content from.WebBrowser1.Document.GetElementById("ID-of-the-element").GetAttribute("innerText")
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
CodenStuff wrote:[/b]ID tagID attribute you mean?
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo![]()
CodenStuff wrote:If you're using a Webbrowser control you can grab the content of elements on a webpage like this:thanks man, but the thing is im not good with html or php so the ID thing is new to me. Mind giving an example?
Code: Select allWhere "ID-of-the-element" would be the ID tag of whichever element you want to pull content from.WebBrowser1.Document.GetElementById("ID-of-the-element").GetAttribute("innerText")
Bloodz_Ninja wrote:It's been a loooong time since I touched VB but I'm proficient in HTML, CSS, and JS so I'll shed some light on that here. (See example weave/code on kodeWeave)CodenStuff wrote:If you're using a Webbrowser control you can grab the content of elements on a webpage like this:thanks man, but the thing is im not good with html or php so the ID thing is new to me. Mind giving an example?
Code: Select allWhere "ID-of-the-element" would be the ID tag of whichever element you want to pull content from.WebBrowser1.Document.GetElementById("ID-of-the-element").GetAttribute("innerText")
HTML = HyperText Markup Language
Example:
Code: Select all
In HTML you markup your content. Like on here we use....
<p id="t1"></p>
<p class="t2"></p>
<p data-call="txt"></p>
<p>
<span></span>
</p>
Code: Select all
to make bold text. Similarly it's done in HTML (although all styling should be done in CSS, but that's a topic for another time).
[b]bold[/b]
Code: Select all
There're many ways to select an element in JS and manipulate it aka DOM manipulation (which is poor in JS, main reason why ReactJS is so popular cause it uses a virtual DOM)<strong>bold</strong>
Here's an example of how you can select elements in JS and manipulate their content...
Code: Select all
var t1 = document.getElementById("t1"),
t2 = document.querySelector(".t2"),
t3 = document.querySelector("[data-call=txt]"),
// t4 = document.querySelector("span"),
t4 = document.getElementsByTagName("span")[0];
t1.innerText = "Hello";
t2.textContent = "world";
t3.innerText = "Hola";
t4.textContent = "mundo";
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023