받은 응답에서 HTML 코드를 긁는 방법은 무엇입니까? (How to scrape the html code from the response received?)


문제 설명

받은 응답에서 HTML 코드를 긁는 방법은 무엇입니까? (How to scrape the html code from the response received?)

스크레이피와 스플래시로 웹사이트를 크롤링하려고 합니다. 이미지에 보이는 응답에서 특정 html 코드를 긁고 싶습니다. 헤더가 있는 응답은 다음과 같습니다. enter image description here

응답은 다음과 같습니다( 스크랩하려는 html): enter image description here

HTML을 찾을 수 있습니다. 검사 도구로. 내 코드가 반환하는 것은 "페이지 소스 보기" 도구로 볼 수 있는 html입니다. 따라서 이것은 Javascript가 코드를 포함하기 전에 수정한다는 것을 의미합니다. 하지만 스플래시 역할은 자바스크립트를 실행하고 HTML을 반환하는 것 아닌가요?? 응답.


참조 솔루션

방법 1:

In order to load the full page, you will need to add the "wait" parameter. Try adding "args={'wait': 1.0}" to your SplashRequest.

yield SplashRequest(
            url='https://www.gaslicht.com/stroom‑vergelijken?partial=true&aanbieders=eneco&skip=0&take=10&_=1559207102962',
            callback=self.parse, args={'wait': 1.0}
        )

(by papmrhaanraadts)

참조 문서

  1. How to scrape the html code from the response received? (CC BY‑SA 2.5/3.0/4.0)

#web-crawler #Python #scrape #html #scrapy






관련 질문

UnicodeError: URL에 ASCII가 아닌 문자가 포함되어 있습니다(Python 2.7). (UnicodeError: URL contains non-ASCII characters (Python 2.7))

크롤링 출력 - 두 변수 연결 (Crawling output - connecting two variables)

Python2.7에서 효과적인 크롤러를 만드는 방법 (How to make an effective crawler in Python2.7)

이 텍스트가 다른 기사의 일부임을 Google에 알리는 방법 (How to tell google this text is part of another article)

크롤링하는 HTML 페이지에서 JavaScript 개체를 구문 분석하는 방법은 무엇입니까? (How to parse a JavaScript object from a HTML page I crawl?)

데이터 크롤링 또는 API 사용 (Crawling data or using API)

파이썬을 사용하여 웹사이트에서 내부 링크만 크롤링 (Crawl only internal links from a website using python)

받은 응답에서 HTML 코드를 긁는 방법은 무엇입니까? (How to scrape the html code from the response received?)

PHP를 사용하여 웹 사이트에서 클래스 이름 스크래핑 (Scraping class name on a website using php)

Scrapy Spider를 사용하는 Craigslist Scraper가 기능을 수행하지 않음 (Craigslist Scraper using Scrapy Spider not performing functions)

BeautifulSoup: 이 링크에서 모든 기사 링크를 가져오는 방법은 무엇입니까? (BeautifulSoup: how to get all article links from this link?)

나는 클라이언트입니다. 선택적으로 http 응답에서 헤더를 제거할 수 있습니까? (I'm client. Can I remove header from http response optionally?)







코멘트