Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to get the html of the web page ScrapeGraphAI received?#919

Unanswered
Tony20221 asked this question inQ&A
Discussion options

I would like to get the html of the web page that ScrapeGraphAI received as a response. I want to compare its content vs what I receive when I use a browser.
How to save the web page's raw HTML in a file?

You must be logged in to vote

Replies: 1 comment

Comment options

Hello@Tony20221! I'm here to help you out with any bugs, questions, or contributions you have. If you need assistance, feel free to ask.

To get and save the raw HTML of the web page that ScrapeGraphAI received, you can use thescrape_do_fetch function from thescrape_do.py module. Here's how you can do it:

# Import the functionfromscrape_doimportscrape_do_fetch# Define your parameterstoken='your_api_token'target_url='http://example.com'use_proxy=False# or True if you want to use a proxygeoCode=None# or specify a country code if neededsuper_proxy=False# or True if you want to use Residential & Mobile Proxy Networks# Fetch the raw HTMLraw_html=scrape_do_fetch(token,target_url,use_proxy,geoCode,super_proxy)# Save the raw HTML to a filewithopen('webpage.html','w',encoding='utf-8')asfile:file.write(raw_html)

This code will fetch the raw HTML of the specified web page and save it to a file namedwebpage.html[1].

To continue talking toDosu, mention@dosu.


Help Dosu learn! Give it feedback:Great Response |Irrelevant Answer |Incorrect Sources |Too Verbose |Hallucination |Other

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@Tony20221

[8]ページ先頭

©2009-2025 Movatter.jp