Tony5895 2 Posted September 12, 2017 Report Share Posted September 12, 2017 Hi I have this HMTL code below, please see https://regex101.com/r/u63Ri6/3 for the full code and my regex: ------------start<tr><td colspan=2><b>Article:</b><br><textarea rows=30 cols=120 style='width:100%;'>The Different Meanings Of Your Check Engine Light With An Auto Services Lincoln Park ChicagoThe lights on your vehicle dash are extremely important.------------end What I try to catch is "The Different Meanings Of Your Check Engine Light With An Auto Services Lincoln Park Chicago". When I try to use the regex101 code I made there within Ubot I get nothing back. Any help appreciated! Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 12, 2017 Report Share Posted September 12, 2017 They have different flavors on the left.I used Python and it worked.I believe it is the same as .Net which is what ubot uses, I have not had any issues thus far. set(#html,"<table width=90%> <tr><td colspan=2> <b>Text Resource Box:</b><br> <textarea rows=15 cols=120 style=\'width:100%;\'>When you are looking for information about auto repair Lincoln Park residents should visit our web pages online today. More details are available at http://www.bucarobrothersautocare.com/ now.</textarea> </td></tr> <tr><td colspan=2> <b>HTML Resource Box:</b><br> <textarea rows=15 cols=120 style=\'width:100%;\'>When you are looking for information about <a href=\"http://www.bucarobrothersautocare.com/\">auto repair</a> Lincoln Park residents should visit our web pages online today. More details are available at http://www.bucarobrothersautocare.com/ now. </textarea> <br> <a href=\'#\' onclick=\'$(\"#old_box\").toggle(); return false;\'>Show Web Version</a><br> <span id=\'old_box\' style=\'display: none;\'>When you are looking for information about <a href=\"http://www.bucarobrothersautocare.com/\">auto repair</a> Lincoln Park residents should visit our web pages online today. More details are available at http://www.bucarobrothersautocare.com/ now.<br><br></span> </td></tr> <tr><td colspan=2> <b>Article:</b><br> <textarea rows=30 cols=120 style=\'width:100%;\'>The Different Meanings Of Your Check Engine Light With An Auto Services Lincoln Park Chicago The lights on your vehicle dash are extremely important. It details essential information regarding the health of your vehicle. Most cars built over the last decade or so provide more preventative measures, so even if a light goes off on the dash, you don\'t need to drop everything and instantly head out to an auto services garage. Instead, you need to have a basic understanding as to what the light you are seeing on your dash means and what to do about it. ","Global") alert($find regular expression(#html,"(?<=<b>Article:<\\/b><br>\\n<textarea rows=30 cols=120 style=\'width:100%;\'>).*")) Probably an easier way of doing this but not sure what you are doing.Have you tried $scrape attribute?Regards,CD Quote Link to post Share on other sites
Tony5895 2 Posted September 13, 2017 Author Report Share Posted September 13, 2017 found the issue. For some reason I must replace rows=30 with rows=\"30\" and style='width:100%;' with style=\"width:100%;\" So the final regex code in Ubot that works is (?<=<b>Article:</b><br>\n<textarea rows=\"30\" cols=\"120\" style=\"width:100%;\">).* Why is that? Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 13, 2017 Report Share Posted September 13, 2017 Not sure but \ is for escaping characters as it is part of the language syntax(Regex). Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 14, 2017 Report Share Posted September 14, 2017 found the issue. For some reason I must replace rows=30 with rows=\"30\" and style='width:100%;' with style=\"width:100%;\" So the final regex code in Ubot that works is (?<=<b>Article:</b><br>\n<textarea rows=\"30\" cols=\"120\" style=\"width:100%;\">).* Why is that? Generally in HTML attribute values are surrounded by quotes, I'm not sure why they are not in your original post but if you're scraping from a webpage they will probably have quotes like that. 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.