access Java Eclipse on pages

So here's my question: I am very interested in computer science and programming, after issuing a search so I wanted to find out whether you can access web pages and there may eg reading labels.

Consider the following story:

It applies anywhere as Youtuber but must meet a minimum number. That is the program then check by going to the specified page of youtubers and there reads the chip. The class is yes: "yt-subscription-button-subscriber-count-branded horizontal yt-uix-tooltip" and you should then access the Title or tabindex ...

Is that even possible? If so, I ask for an explanation or an ex. How that works ... possibly even unnecessary programs or similar ...

The best answer

I think it is easiest with JavaScript that is "injected" when the page.

var eineliste = document.getElementsByClassName('meineklasse'); var zahldieichwill = eineliste[0].innerHTML;

So hast du eine Variable mit dem gewünschten Wert. Eigentlich ist Java für so etwas aber zu komplex, ein einfaches JavaScript reicht ja.

I once made with VBScript something like that, maybe you can implement the in java:

set ie = CreateObject ( "InternetExplorer.Application")
ie.navigate url
ie.visible = true
Do Until IE.readyState = 4
Do while IE.busy
classarr = ie.document.getElementsByClassName ( "yt-subscription-button-subscriber-count-branded horizontal")

classarr is an array of HTML tags with this class. So ambiguous. It would be better to have with getElementByID to the ID of the desired tags to access, this would however have the (unique) ID attribute.

Okay, here (

http: // ...

) You can find information as you code the HTML of the website in a Java String get. The string you are looking then after cutting with the right ID and extracts the contents of the span. Note, however, that you have to change your program as soon as YouTube change the ID on its website.

Date: 2019-06-15 Views: 1

Related articles



Copyright (C) 2019, All Rights Reserved.

M3tch all rights reserved.

processed in 0.115 (s). 9 q(s)