小编P. *_*yan的帖子

刮擦,飞溅,lua,按钮单击

我是这里所有乐器的新手。我的目标是从许多页面中提取所有URL,而这些页面通过“ Weiter” /“ next”按钮(多个URL)连接得更多。我决定尝试一下。该页面是动态生成的。然后,我得知我需要另一台仪器,并为此安装了Splash。安装正在运行。我根据教程设置了安装。然后,我通过在搜索输入字段中发送“返回”来设法获得第一页。使用可以给我所需结果的浏览器。我的问题是,我尝试单击生成的页面上的“下一个”按钮,但不知道具体如何。正如我在几页上所读到的那样,这并不总是那么容易。我尝试了建议的解决方案,但没有成功。我想我不太远,希望能有所帮助。谢谢。

我的settings.py

BOT_NAME = 'gr'
SPIDER_MODULES = ['gr.spiders']
NEWSPIDER_MODULE = 'gr.spiders'
ROBOTSTXT_OBEY = True
DOWNLOADER_MIDDLEWARES = {
    'scrapy_splash.SplashCookiesMiddleware': 723,
    'scrapy_splash.SplashMiddleware': 725,
    'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 810,
}
SPLASH_URL = 'http://localhost:8050'
SPIDER_MIDDLEWARES = {
    'scrapy_splash.SplashDeduplicateArgsMiddleware': 100,
}
DUPEFILTER_CLASS = 'scrapy_splash.SplashAwareDupeFilter'
HTTPCACHE_STORAGE = 'scrapy_splash.SplashAwareFSCacheStorage'
Run Code Online (Sandbox Code Playgroud)

我的蜘蛛:

# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy_splash import SplashRequest
import json
# import base64

class GrSpider(scrapy.Spider):
    name = 'gr_'
    allowed_domains = ['lawsearch.gr.ch']
    start_urls = ['http://www.lawsearch.gr.ch/le/']

    def start_requests(self):

        script = """
        function …
Run Code Online (Sandbox Code Playgroud)

python lua scrapy scrapy-splash splash-js-render

6
推荐指数
1
解决办法
1153
查看次数

标签 统计

lua ×1

python ×1

scrapy ×1

scrapy-splash ×1

splash-js-render ×1