{"id":13633,"date":"2021-12-13T13:19:56","date_gmt":"2021-12-13T13:19:56","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=13633"},"modified":"2021-12-13T13:20:59","modified_gmt":"2021-12-13T13:20:59","slug":"solved-parse-html-file-with-vbscript","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/parse-html-file-with-vbscript\/29633.html","title":{"rendered":"Solved Parse Html File With VBScript"},"content":{"rendered":"<p>Hello all,<\/p>\n<p>I am writing a script to bulk copy\/rename files, and need a little help. I really don&#8217;t have any experience with vbscript, however I think I&#8217;ve done pretty well thus far getting to where I am.<\/p>\n<p>I need help writing a portion of code that will loop until it finds a given file name. For example, the part of the html file looks like this:<\/p>\n<p>&nbsp;<\/p>\n<pre>&lt;td width=544 valign=top style='width:407.7pt;padding:0cm 5.4pt 0cm 5.4pt'&gt;\r\n  &lt;p class=OHHpara align=left style='text-align:left'&gt;&lt;span style='font-size:\r\n  11.0pt'&gt;&lt;a href=\"#\"&gt;Servicing Agreement&lt;\/a&gt;&lt;\/span&gt;&lt;\/p&gt;\r\n<\/pre>\n<p><b>EDIT:<\/b> Not sure why, but the # in the href should be a link to a local document, in this case 08.pdf. It keeps changing to a # when I edit it.<\/p>\n<p>I need help getting the script to locate the file name given, in this case &#8220;08.pdf&#8221;, which I already have stored in a variable. I then need it to get the text that follows, in this case &#8220;Servicing Agreement&#8221; and store it in a new variable. In this case, the text is all on the same line, however there are ones that will be longer and span two+ lines. So I need the text between the following &gt; and &lt;<\/p>\n<p>I think I can manage the copying\/renaming myself, but I am lost as to how to correctly parse this file&#8230; Can anyone help?<\/p>\n<p>I can post the code I have so far, as long as you all promise not to laugh ;).. It&#8217;s a Frankenstein of examples I&#8217;ve found online and is very likely not optimal, but so far does what I need I think.<\/p>\n<p>Thank you,<\/p>\n<p>Matt<\/p>\n<p><span style=\"color: gray; font-size: small;\">Can I put a question here?<br \/>\n<\/span><\/p>\n<p align=\"right\"><span style=\"font-size: xx-small;\"><i>message edited by Matt123<\/i><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":14},"question-category":[55],"question_tags":[],"class_list":["post-13633","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/13633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=13633"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=13633"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=13633"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=13633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}