Dgameman1 Posted December 12, 2015 Posted December 12, 2015 (edited) I have a String that I'm trying to get the text between of.The string is something like user/Dgameman1" class="author I'm trying to get everything between user/ and " class="authorThis is the code I currently have StringRegExp($HTML,'(\/user\/)(.+?)(\" class)', 3)But for whatever reason, this isn't returning the value and I'm not sure how to go about fixing the Regex Expression. Thank you guys so much Edited December 12, 2015 by Dgameman1
iamtheky Posted December 12, 2015 Posted December 12, 2015 $s = 'user/Dgameman1" class="author' msgbox(0 , '' , stringregexp($s , 'user\/(.*?)\" class' , 3)[0]) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Dgameman1 Posted December 12, 2015 Author Posted December 12, 2015 I guess that's not the only thing wrong with my code then.This is what I have so far#include <IE.au3> $Texans = _IECreate("https://www.reddit.com/r/texans", 0, 1, 1) $TexansHTML = _IEDocReadHTML($Texans) $TexansUsernames = StringRegExp($TexansHTML,'user\/(.*?)\" class', 3) MsgBox(1,"lol",$TexansUsernames[0]) ;_IEQuit($Texans) I don't just get what's in between the user and the class
iamtheky Posted December 12, 2015 Posted December 12, 2015 (edited) close, no need for class#include <IE.au3> #include <array.au3> $Texans = _IECreate("http://www.reddit.com/r/texans", 0, 0, 1) $TexansHTML = _IEDocReadHTML($Texans) _IEQuit($Texans) $TexansUsernames = StringRegExp($TexansHTML,'user\/(.*?)\"', 3) _ArrayDisplay($TexansUsernames) Edited December 12, 2015 by iamtheky Dgameman1 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Dgameman1 Posted December 12, 2015 Author Posted December 12, 2015 You're god's gift to mankind. Thank you so much
mikell Posted December 12, 2015 Posted December 12, 2015 Depending on the further use, Inet could be used - much faster#Include <Array.au3> $source = BinaryToString(InetRead("https://www.reddit.com/r/texans", 1)) $res = StringRegExp($source,'user/(.*?)"', 3) _ArrayDisplay($res) Dgameman1 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now