Menu

following a button link

Help
Anonymous
2018-04-11
2019-01-23
  • Anonymous

    Anonymous - 2018-04-11

    <button class="btn" type="BUTTON" onclick="self.location='/s/10572453/57/Alias'">Next ></button>

    how do you follow a button link, like above?

    In the command prompt I get this result:

    * Retrieving (GET): https://www.fanfiction.net/s/10572453/57/Alias
    * Processing: https://www.fanfiction.net/s/10572453/57/Alias

    * Retrieving (): https://www.fanfiction.net/s/10572453/57/Next >
    * Processing: https://www.fanfiction.net/s/10572453/57/Next%20%3E

    the second retrieving should have 58 in the link and the get request is missing..

    I tried this css selector in the command prompt

    -f "css('#content_wrapper_inner > span:nth-child(7) > button:last-child')"

     
  • Reino

    Reino - 2019-01-23

    I don't normally use CSS expressions (Benito would have to answer that), but an XPath expression on Linux would be:

    xidel "https://www.fanfiction.net/s/10572453/57/Alias" -f '//span/button[starts-with(.,"Next")]/extract(@onClick,"'\''(.+)'\''",1)' -e '$url'
    **** Retrieving (GET): https://www.fanfiction.net/s/10572453/57/Alias ****
    **** Processing: https://www.fanfiction.net/s/10572453/57/Alias ****
    **** Retrieving (): https://www.fanfiction.net/s/10572453/58/Alias ****
    **** Processing: https://www.fanfiction.net/s/10572453/58/Alias ****
    https://www.fanfiction.net/s/10572453/58/Alias
    

    On Windows that would be:

    xidel "https://www.fanfiction.net/s/10572453/57/Alias" -f "//span/button[starts-with(.,'Next')]/extract(@onClick,'''(.+)''',1)" -e "$url"
    
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.