从使用 javascript 的网站抓取数据 [英] Scraping data from website that uses javascript

查看:57
本文介绍了从使用 javascript 的网站抓取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个检查大学课程可用性的程序,但该网站使用 JavaScript 来显示课程及其时间.使用 Java,我正在抓取这些数据并使用它来告诉用户何时打开类.

I'm currently working on a program that checks University class availability but the website uses javascript to display classes and their times. Using Java, I'm working on scraping this data and using it to tell users when classes are open.

我尝试过使用 Selenium,但我真的不知道如何很好地使用它.有没有更简单的方法来做到这一点?

I've tried using Selenium but I do not really know how to use it very well. Is there an easier way to do this?

推荐答案

没有具体就很难知道.但是我假设如果数据在加载时不在页面中,他们可能会使用 AJAX 来加载它.

Without specific is hard to know. But I assume that if the data is not in the page at load time they may be using AJAX to load it.

正如我所说的,我可能假设太多了,但您的问题很模糊,如果他们使用 AJAX,请检查他们所做的调用(如果幸运的话,可以得到 json 响应),您的工作将非常容易.

As I said I may be assuming too much, but your question is vague, if they use AJAX, check the call they do (and get a json response with a bit of luck) and your work will be extremely easy.

这篇关于从使用 javascript 的网站抓取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆