Copy to clipboard problem - need solution

Discussion in 'Questions' started by ek3ekytop, Jan 11, 2019.

  1. ek3ekytop

    ek3ekytop Новичок

    Joined:
    Mar 9, 2012
    Messages:
    28
    Likes Received:
    0
    Hi. I'm working on reddit comment poster, but I have a little problem. I need to get the url of my comment after it is been posted. Everything works and even reddit shows that the link is been copied to the clipboard - see this
    [​IMG]

    But nothing is copied at all. It works when i click manually "copy link" I tried to scrape the link from the source code , but it can't be found.
    Any idea why the link is not copied to clipboard ? Or how to do it properly?
    Thanks in advance !
     
  2. Snowflake

    Snowflake Новичок

    Joined:
    Nov 15, 2017
    Messages:
    4
    Likes Received:
    0
    Try this(C#):
    Code (text):
    1. return System.Windows.Forms.Clipboard.GetText();
    In C# block use return to variable 8-)
     
  3. ek3ekytop

    ek3ekytop Новичок

    Joined:
    Mar 9, 2012
    Messages:
    28
    Likes Received:
    0
    Yes, this is what I use to write copied link to text file, but it only works when I click manually. When the script click on it, there no copied data to clipboard. Page showing copied link (as it is in the gif above) but no copied data to clipboard ... Really weird
     
  4. ek3ekytop

    ek3ekytop Новичок

    Joined:
    Mar 9, 2012
    Messages:
    28
    Likes Received:
    0
    It paste my previously copied text from the clipboard on every loop and create repeating lines in my txt file (if this matters)
    I still need a solution. Now I work with the script with a breakpoint to click on "copy link" manually, but it is really annoying ...
     
  5. lokiys

    lokiys Moderator

    Joined:
    Feb 1, 2012
    Messages:
    3,484
    Likes Received:
    782
    Hi. Thats surely is a problem.
    But as workaround there are everything in source.
    I can find comment link easy. https://i.imgur.com/sx9VZXf.png
    I guess You have to reload page if comment is not found right away after posting.
     
    ek3ekytop likes this.
  6. ek3ekytop

    ek3ekytop Новичок

    Joined:
    Mar 9, 2012
    Messages:
    28
    Likes Received:
    0
    Thank you very much lokiys. I don't know how i miss it the first time when trying to do it. Now after I created RegEx to parse it, the script works just fine ... even no need to reload the page.
    Thanks again!
     

Пользователи просматривающие тему (Пользователей: 0, Гостей: 0)