Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the video tag, src data for my website #681

Open
brucechen09 opened this issue Sep 19, 2024 · 1 comment
Open

How do I get the video tag, src data for my website #681

brucechen09 opened this issue Sep 19, 2024 · 1 comment

Comments

@brucechen09
Copy link


I need to crawl the e-commerce product page of the product name, pictures and videos,but you can't get accurate video and image urls

Code down
def create_speech_graph(html):
speech_graph = SmartScraperGraph(
prompt="List me all the images with their visual description",
source= html,
config=graph_config,
)
return speech_graph

给定一个url下载html内容

def download_html(url):
import requests
response = requests.get(url)
return response.text

执行download_html方法,在执行create_speech_graph方法

html = download_html("https://www.amazon.com/Misxi-Waterproof-Anti-Scratch-Protector-Transparent/dp/B0C9PSGY6Q?th=1")

如果speech_graph不为空,则运行speech

speech_graph = create_speech_graph(html)
if speech_graph:
result = speech_graph.run()
output = json.dumps(result, indent=2)
line_list = output.split("\n") # Sort of line replacing "\n" with a new line
for line in line_list:
print(line)

@VinciGit00
Copy link
Collaborator

ok, what's the output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants