[Help]DOMS/GetElementByID/tags

Posts 1–13 of 13 · Page 1 of 1
[Help]DOMS/GetElementByID/tags
Hi, i need help, im making a tool for a site.. and im wondering how would i make the following

Login then

check if your a member then

check post count

If you dont no what u mean plz say so. i will explain a bit better
This has been discussed in a few other topics

For Login , Use GetelementbyId then pass using DOMS to the innertext or innerHtml

Checking if the user is a member depends on if you hae access to the database, you can A. use a database string and check it against the database, or you can do what I have suggested in the case of forums which is use check for a element that is unique to a member, example here would be checking for the search element, it is only present if a member is logged in.

Posts in the sense of a forum are wrapped in a div, not with a ID , so to check it you would have to scan the HTML, I wrote a span example a while ago, I'll try and locate it for you .



Could u or someone put it in VB format im not 100% familier with VB. but have made a few programs. just not one like this

and okay.. Thanks
If you tell us the site, we can give you the actual code to help you out.

A Example would be

WebBrowser1.Document.GetElementById("Id Name").InnerText(TextBox1.Text)

This will post the information to the website
i dont think i can post it here.. can i PM u?
The site is a rival site, So I will offer general Vb.net help, but not direct help with the site.
Well Could My Question still be ok to answer?
yes, Mnpeep has been in here writing it up for 8 mins or so, I'll let him finish up

Essentially you need the ElementID, ElementTags

Element Tags are <div></div>
Element ID's are ID=Yada

Knowing that will help, so you want to first Login

(I suggest google Chrome, you can use the webkit to inspect element and view that line without having to search the code)
that is

UserName Field
[php]
WebBrowser1.Document.GetElementById("Id Name of UserName Textbox").InnerText(TextBox1.Text)
[/php]

//assuming text box 1 on your form is being used for username

[php]
WebBrowser1.Document.GetElementById("Id Name of password Textbox").InnerText(TextBox2.Text)
[/php]

//assuming Text box 2 is being used for password field

Next is validating the user is a member and is logged in, I am doubting you have access to the database, in which case, You can use a workaround,

In the case of mpgh, if you are not logged in , the ID "navbar_search" is not present,
if you are logged in then the ID "navbar_search" does exist.

You can check for the existence of a ID using

[php]
If webbrowser1.document.getElementById("navbar_search ") IsNot Nothing Then
' User Is Logged In
Else
'User Is Not Logged In , or is not a member
End If
[/php]

Checking post may be easy if you are lucky enough and the creator gave the Div a ID tag, in mpgh.net this is not the case, two many div's to even work it out,

You maybe able to use Forms to get it , but you will need some string manipulation

[php]
WebBrowser1.document.window.frames(whatever the framename is').document.body.innerHTML
[/php]
again, assuming that there is a frame, and it has a name.

I would really have to view the source, but with the website down, I can't even do that atm.


Quote Originally Posted by HaroldAndKumar View Post
me neither...........
Login:

Go to the page with the login and right click it. Click "View Page Source" (Firefox).

Something will popup.

Hit CTRL+F and search "User"

There should be a long line, keep searching until you see "id="

The text after it is the id/

For example, an MPGH login user name ID is "navbar_username"

Password is "navbar_password"

So just put a webbrowser and a button on the form.

And in the button put:

Code:
WebBrowser1.Document.GetElementById("navbar_username").SetAttribute("value", "HaroldAndKumar")
*I used this code for my Nexon Passport Creator.

And so on.

If something is unclear, just ask. I just wrote this up in a couple of minutes.
Yeah, that was answered already
\Edit: BTW Google Chrome for the win

Right click examine component or something smilar to that.
Yeah google chrome (webkit) allows us to inspect a single element instead of searching the whole source, firefox has an addon for it, but it's just not the same.
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us