How to get xpath/css selector programmatically wxhile i have html code of tag.

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
razi
Posts: 4
Joined: Mon Jun 03, 2019 7:57 am

How to get xpath/css selector programmatically wxhile i have html code of tag.

Post by razi » Mon Sep 02, 2019 10:14 am

Hi 8)
This is my first post here. I am facing a problem and did not find any solution.
I making application with vb.net who fills contact forms of different websites. I can get html code of tag like this
<input type="text" name="contact_name" id="name" required="required" placeholder="Your Full Name" data-required="Name is required" class="first-child last-child">.
Is there any way to find xpath/selector pragmatically so that i can work with this tag later. Different contact forms have differnet inputs with different names and attributes. I using visual basic dot Net.

Appologise for bad english.

Thanks!
Tom, Tech Support
Posts: 3577
Joined: Mon May 31, 2010 4:59 pm

Re: How to get xpath/css selector programaticaly while i have html code of tag.

Post by Tom, Tech Support » Mon Sep 02, 2019 1:48 pm

Hi razi,

I deleted your similar post in the Command Line and Scripting Interface forum and I may move this post to a different forum once it becomes more clear what you are actually intending to do.
razi wrote:
Mon Sep 02, 2019 10:14 am
I can get html code of tag like this

Code: Select all

<input type="text" name="contact_name" id="name" required="required" placeholder="Your Full Name" data-required="Name is required" class="first-child last-child">
Is there any way to find xpath/selector pragmatically so that i can work with this tag later.
Please help me (and anyone else reading this topic) to understand better the "what and why" of your request.

Are you saying that you are already extracting the raw HTML of the web page using your VB.NET code, and you would like to be able to convert this to an iMacros TAG command for use in a macro?
Regards,

Tom, iMacros Support
razi
Posts: 4
Joined: Mon Jun 03, 2019 7:57 am

Re: How to get xpath/css selector programmatically wxhile i have html code of tag.

Post by razi » Sat Sep 21, 2019 9:30 am

I don,t want to convert it into imacro code. I just want to generate xpath of element programaticaly. Many times i get html tags code and i have to perform action on some of them. So if conditions meet then actions performed on those elements for this purpose i need to generate xpath programaticaly.

Thanks!
Tom, Tech Support
Posts: 3577
Joined: Mon May 31, 2010 4:59 pm

Re: How to get xpath/css selector programmatically wxhile i have html code of tag.

Post by Tom, Tech Support » Sun Sep 29, 2019 12:55 pm

Okay, so it sounds like your question is not specifically related to iMacros then. You might want to consider doing a general web search on XPATH as you may find an answer quicker that way.
Regards,

Tom, iMacros Support
Post Reply