Jump to content
UBot Underground

Scrape One, Ignore Other, In Similar HTML


Recommended Posts

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>
Link to post
Share on other sites

Try this

set(#xpath, $plugin function("HTTP post.dll", "$xpath parser", "html", "//div[@data-screen-name=\'ClassicalPurist\']", "data-user-id", "HTML"), "Global")
Link to post
Share on other sites

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.

Link to post
Share on other sites

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

 

 

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...