giganut 109 Posted November 23, 2014 Report Share Posted November 23, 2014 Hello, I need some help. For the last 48hr I have been trying to scrape user names from the html below. I can scrape the user names just fine but my problem is that I only need to grab user names from one of the buttons and not the other. The only indicator that shows they are different are the lines above the user name. I need to scrape the username name from this button code: data-screen-name="ClassicalPurist" <div class="ProfileCard-actions"> <div class="ProfileCard-userActions with-rightCaret js-userActions"> <div class="UserActions UserActions--small u-textLeft" > <div class="user-actions btn-group not-following not-muting can-dm " data-user-id="1900159939" data-screen-name="ClassicalPurist" data-name="Classical Purist" data-protected="false"> <span class="UserActions-moreActions u-inlineBlock"> <button type="button" class="js-tooltip unmute-button btn small plain-btn" title="Unmute @ClassicalPurist" data-placement="top"> <span class="Icon Icon--muted Icon--medium"><span class="visuallyhidden">Unmute @ClassicalPurist</span></span> </button><button type="button" class="first-load js-tooltip mute-button btn small plain-btn" title="Mute @ClassicalPurist" data-placement="top"> <span class="Icon Icon--unmuted Icon--medium"><span class="visuallyhidden">Mute @ClassicalPurist</span></span> </button>And Ignore the username from this code: data-screen-name="Sougograio" <div class="ProfileCard-actions"> <div class="ProfileCard-userActions with-rightCaret js-userActions"> <div class="UserActions UserActions--small u-textLeft" > <div class="user-actions btn-group following not-muting can-dm including " data-user-id="332657730" data-screen-name="Sougograio" data-name="相互ãŸã‚“" data-protected="false"> <span class="UserActions-moreActions u-inlineBlock"> <button type="button" class="js-tooltip unmute-button btn small plain-btn" title="Unmute @Sougograio" data-placement="top"> <span class="Icon Icon--muted Icon--medium"><span class="visuallyhidden">Unmute @Sougograio</span></span> </button><button type="button" class="first-load js-tooltip mute-button btn small plain-btn" title="Mute @Sougograio" data-placement="top"> <span class="Icon Icon--unmuted Icon--medium"><span class="visuallyhidden">Mute @Sougograio</span></span> </button> Quote Link to post Share on other sites
Aymen 385 Posted November 23, 2014 Report Share Posted November 23, 2014 Try this set(#xpath, $plugin function("HTTP post.dll", "$xpath parser", "html", "//div[@data-screen-name=\'ClassicalPurist\']", "data-user-id", "HTML"), "Global") Quote Link to post Share on other sites
giganut 109 Posted November 23, 2014 Author Report Share Posted November 23, 2014 Thank you for your reply, but I would need to scrape the page that has mutiple different buttons and mutiple different usernames. Here is the whole page below. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted November 23, 2014 Report Share Posted November 23, 2014 Try this set(#un,$plugin function("HTTP post.dll", "$xpath parser", $document text, "//div[@class=\'user-actions btn-group not-following not-muting can-dm \']", "InnerText", "HTML"),"Global") clear list(%not following) add list to list(%not following,$list from text($find regular expression(#un,"(?<=@).*"),$new line),"Delete","Global") CD I fixed it, now gets correct users 2 Quote Link to post Share on other sites
giganut 109 Posted November 24, 2014 Author Report Share Posted November 24, 2014 Thank you TC that works great 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted November 24, 2014 Report Share Posted November 24, 2014 No Problem! 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.