batman110391 / scrape-html-web Goto Github PK
View Code? Open in Web Editor NEWExtract content from a static HTML website.
License: MIT License
Extract content from a static HTML website.
License: MIT License
Hi! I'm continuously getting this error with the way my code is structured and wondering if you can point me into the right direction.
Trying to use it in a component that will pull the img url from zillow, but even when I'm using your test case I'm getting this error.
import { scrapeHtmlWeb } from "scrape-html-web";
export const getImageUrls = async (url) => {
const options = {
url: url,
bypassCors: true,
mainSelector:".blog-index",
childrenSelector: [
{ key: "img", selector: "time", attr: "text" },
],
};
(async () => {
const data = await scrapeHtmlWeb(options);
console.log(data);
// return data
})();
}
import { useEffect, useState } from "react";
import { getImageUrls } from "../hooks/getImageUrls";
const ZillowImage = (url) => {
const [imgUrl,setImageUrl] = useState(null);
useEffect(() => {
getImageUrls(url)
.then((data) => {
setImageUrl(data)
});
},[])
return (!imgUrl ? (
<div>Loading...</div>
) : (
<div>
<img src={imgUrl[0].img}></img>
</div>
)
)
}
export default ZillowImage;
Thanks in advance if you have any suggestions on how to overcome this error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.