dongxiaoke2018 2014-10-08 20:35
浏览 74
已采纳

是否可以通过CURL / WGET访问CSS按钮?

I am trying to click on a CSS button via CURL/WGET, however so far I am having no luck. The exact link location for the CSS button is a dynamic URI - for example:

domain.com/some/page?thing=1

Still when you access that page via curl/wget it does not trigger the action. There is a CSS selector which I need to access somehow. I found this:

http://codeception.com/docs/modules/PhpBrowser

However it requires installing additional software which is not an option. I need something that would work with curl/wget or perhaps a sample PHP script. I tried providing the following argument to wget:

--header="selector: some-selector"

However it does not achieve the desired result.

Here is some more information from the comment, so that it is easier to see:

I've got the HTTP headers and tried to replicate them but with no luck. They are too long so I uploaded example headers to:

http://textuploader.com/oopa

Could anyone provide example script/command that could be used to achieve the above?

The action is not triggered by accessing the url - it requires you to click on a button. I have provided HTTP headers in my previous command. Here is what the exact button looks like when inspected:

<div style="margin-bottom:15px;">

  <a style="display:block; width:350px" href="http://www.test.com/hos/6/42?game=1" id="game-one">
    <img src="http://www.test.com/images/thumbs_up.jpg" width="24" height="24" />
                           Sample Text
  </a>

</div>

So basically I need to activate the game-one selector some how - simulate a click on that button via a script. The PHPBrowser that I mentioned above seems to offer this functionality, however I cannot install it as it requires additional software which is not an option in this case.

  • 写回答

2条回答 默认 最新

  • dongzhao5834 2014-10-08 22:20
    关注

    Thanks for the help everyone.

    I was actually able to figure this out - it is possible via CURL. It appears that it was necessary to add referer set for the previous page, so in order to access the dynamic URI and trigger the action I used the following CURL:

    curl --head --referer 'http://www.test.com/hos/6/42' http://www.test.com/hos/6/42?game=1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA