简体   繁体   English

使用 selenium chrome 部署网页抓取网站

[英]Deploying web scraping website with selenium chrome

I have created a website that scrapes multiple hockey websites for game scores.我创建了一个网站,可以从多个曲棍球网站上获取比赛分数。 It runs perfectly on my local server and I am now in the process of trying to deploy.它在我的本地服务器上完美运行,我现在正在尝试部署。 I have tried using pythonanywhere.com but selenium does not seem to be working on it.我曾尝试使用 pythonanywhere.com,但 selenium 似乎没有在处理它。 For any one who has deployed a website that uses selenium/webdriver, what is the easiest/best platform to deploy a website like this (it does not have to be free like pythonanywhere, as long as it is not too expensive, lol!).对于任何部署了使用 selenium/webdriver 的网站的人来说,部署这样的网站的最简单/最好的平台是什么(它不必像 pythonanywhere 那样免费,只要不是太贵,哈哈!) . Thanks in advance提前致谢

Selenium does work on PythonAnywhere. Selenium 确实适用于 PythonAnywhere。 If you use a free account, you'd have restricted internet access though.如果您使用免费帐户,则您的互联网访问会受到限制。 Also it's recommended to scrape outside of the web app, since it would slow the views down -- you should rather use a Schedule/Always-on task for that instead.此外,建议在 Web 应用程序之外进行抓取,因为它会减慢视图速度 - 您应该为此使用 Schedule/Always-on 任务。 You can also refer to those PythonAnywhere help pages:您还可以参考这些 PythonAnywhere 帮助页面:

You can use the AWS, GCP, or Digitalocean Linux servers.您可以使用 AWS、GCP 或 Digitalocean Linux 服务器。 In this case, you first have to install chrome in Linux and then put the relevant version of the chrome driver in your project directory.在这种情况下,您首先必须在 Linux 中安装 chrome,然后将相关版本的 chrome 驱动程序放在您的项目目录中。 Make sure to check the chrome version first and then put the relevant Chrome driver on your machine.确保先检查chrome版本,然后将相关的Chrome驱动程序放在您的机器上。

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

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