简体   繁体   English

从 linux 命令行触发网页视图

[英]Trigger webpage view from linux command line

I am using a shared file download service which deletes the file if the file's web page has not been visited in 30 days.我正在使用共享文件下载服务,如果文件的 web 页面在 30 天内未访问过,该服务将删除该文件。 I need to store my files for longer than 30 days.我需要将文件存储超过 30 天。

I am using a Centos 7 based Linux server.我正在使用基于 Linux 服务器的 Centos 7。

My idea was to create a cron to run a bash script with a command line for each file.我的想法是创建一个 cron 来运行 bash 脚本,每个文件都有一个命令行。

I have tried using the wget, curl and lynx commands but these do not register as the page being visited.我曾尝试使用 wget、curl 和 lynx 命令,但这些不会注册为正在访问的页面。

Any ideas on a command that I can use?关于我可以使用的命令的任何想法?

The file sharing service is gofile.io and an example file I have uploaded (on the page that is required to be visited) is https://gofile.io/?c=znRpuJ文件共享服务是 gofile.io,我上传的一个示例文件(在需要访问的页面上)是https://gofile.io/?c=znRpuJ

Edit: After looking into it further there appears to be a javascript function which needs to be activated which I think isn't activated by wget/curl/lynx.编辑:在进一步研究之后,似乎有一个 javascript function 需要激活,我认为 wget/curl/lynx 没有激活它。 Is there any way to activate this javascript from the command line?有没有办法从命令行激活这个 javascript?

Try this:尝试这个:

  1. Make sure you have Python3.确保你有 Python3。
  2. Install geckodriver.安装壁虎驱动程序。
  3. pip install selenium for Python3. pip 为 Python3 安装 selenium。
  4. Run the following script:运行以下脚本:

from selenium import webdriver driver = webdriver.Firefox() driver.get("https://gofile.io/?c=znRpuJ" driver.quit()

Good luck.祝你好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM