Reputation: 0 Apprentice
- New Members
- Active Posts:
- 5 (0.02 per day)
- 07-October 12
- Profile Views:
- Last Active:
- Oct 30 2012 10:27 AM
- Dream Kudos:
Posts I've Made
Posted 8 Oct 2012The reason it isn't their is possible because css tags list keeps growing. As for as you said, it won't take a long time to write your own. Just parse the values of those tags.
For taking care of relative urls i remember doing similar in a past project, you can use Uri Class
The Uri(string, string) constructor should help you where 1st parameter is base url and second is relative url
Dim url as New Uri("http://www.website.com/somepage.html", "/image.jpg")
Thanks for the tip!
Posted 8 Oct 2012I am not sure what sort of built in functionality you were expecting?
See the last code block in my original post. Something like that would make it much easier than trying to figure out all of the possible relative URL paths (of which there are many), and then having to write code to handle each one.
Anyways, it appears that something like that does not exist, so I guess it's time for me to get off the forum and build it myself!
Posted 8 Oct 2012
QuoteNo, the sites will vary, and will not be known ahead of time (they will be input by the end user).
*sigh* Yes, but at some point the user will tell the application the location of the site to point to, right? That is when it 'knows'.. that is when it stores that directory and then rips apart the CSS. It's nothing but a bit of regex or string manipulation and maybe take thirty minutes to write up.
Sorry, I misunderstood what you were asking. It might take YOU 30 minutes to code, but I'm not a VB "guru" such as yourself, so it would probably take me the better part of an afternoon to figure out how to do all that. Which is why I was looking for a more efficient solution. If I can't find one... guess I will bite the bullet and roll up my sleeves. I'm just surprised that MS does not provide a built-in function to accomplish this.
Posted 8 Oct 2012You know the path of the site, right? Append that to the image paths from the css.. sure a bit of trickery when dealing with the ../ but it should be as simple as smashing two strings together.
No, the sites will vary, and will not be known ahead of time (they will be input by the end user). So, I will have to account for every possible scenario in the code.
I was really hoping that there was a simple way to do this. It's strange that MS would make it easy to extract any HTML element from a page, but not have an easy way to also extract CSS styles from a page.
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
NotQuiteThereYet hasn't added any friends yet.