Comments (7)
I can take a look at this (accepted the task in Google CodeIn 2016 😉). Can you maybe tell me what version of node and npm you're using? Just run node --version
and npm --version
.
from html-metadata.
Also, I'm just going to assume that debug()
is a variant of console.log()
or console.error()
.
from html-metadata.
$ node --version v6.9.4
$ npm --version 3.10.10
And yes, sorry , debug just handles/displays to console
Let me know if I can be of any help or you need more info.
Thanks.
from html-metadata.
I'm having trouble reproducing this bug. Here's the versions of everything I've tested it on:
Windows 10 Home x64
==========
- Node v6.8.1 & npm v3.3.11
Ubuntu 14.04.5 LTS
==========
- Node v4.7.2 & npm v2.15.11
- Node v6.9.4 & npm v3.10.10
- Node v7.4.0 & npm v4.0.5
Here's the code that I used for my testing:
const htmlMetadata = require('html-metadata');
function testCallbackBased() {
htmlMetadata('http://www.google.com', (err, metadata) => {
if (err) {
console.error('[testCallbackBased]: Scraper html-metadata failed! ', err);
}
else {
console.log('[testCallbackBased]: html-metadata returned: ', metadata);
}
});
}
function testPromiseBased() {
htmlMetadata('http://www.google.com')
.then((m) => console.log('[testPromiseBased]: html-metadata returned: ', m))
.catch((e) => console.error('[testPromiseBased]: Scraper html-metadata failed! ', e));
}
testCallbackBased();
testPromiseBased();
In all scenarios, the above code produces output like this:
$ node .
(node:13152) DeprecationWarning: parse() is deprecated, use toJson()
[testPromiseBased]: html-metadata returned: { general: { title: 'Google', lang: 'en-CA' },
openGraph:
{ description: 'Sandford Fleming’s 190th Birthday! #GoogleDoodle',
image:
{ url: 'http://www.google.com/logos/doodles/2017/sandford-flemings-190th-birthday-5693910618734592.2-thp.png',
width: '519',
height: '230' } },
schemaOrg: { items: [ [Object] ] } }
[testCallbackBased]: html-metadata returned: { general: { title: 'Google', lang: 'en-CA' },
openGraph:
{ description: 'Sandford Fleming’s 190th Birthday! #GoogleDoodle',
image:
{ url: 'http://www.google.com/logos/doodles/2017/sandford-flemings-190th-birthday-5693910618734592.2-thp.png',
width: '519',
height: '230' } },
schemaOrg: { items: [ [Object] ] } }
This is all with html-metadata
at the lastest commit (958991b) and at v1.6.2
.
I've honestly got no idea what's going on here - I looked at all the files mentioned in your stacktrace, and I can't find any issues. Did you maybe want to try reinstalling html-metadata
? Or do you have a repo that I can look at?
from html-metadata.
Hey @brezuicabogdan, so I chatted with @mvolz and we think that since no one can reproduce this issue we might have to close it... Sorry 😓
I'd still be totally willing to help you with this problem whenever you want - it just doesn't seem to be thus module's fault.
Again, sorry about this!
from html-metadata.
It's on @jo12bar , I am a developer I know how this works. I only submitted this bug report because I know bugs are important to developers and I would like people to do this for me too. I managed to resolve my problem with another module for not and I will get back to html-metadata as soon as I find the time. I will try to find the problem myself but I am not very experienced with NodeJs (I'm a PHP developer myself). I will send you a PM if I need help.
Thanks for everything.
from html-metadata.
Hi all, I am not experiences in how to contribute in such an open source project.
But I stumpled on this error, and it seems to be caused by line 31 in lib/index.js where a for of loop is used. This will at least in my version of node (v10.16.3) result in custom functions on the Array object together with the actual entries. Thus if one has a custom function on the array prototype, this will fail.
The solution is to use Object.keys(results) instead, or any other means that do not include the prototype functions.
I hope it helps, my local copy is patched and it works wonderfully:-)
Cheers
Mads
from html-metadata.
Related Issues (20)
- html-metadata returns all fields as undefined for specific url HOT 5
- Not working on nytimes.com HOT 3
- Release? HOT 1
- cheerio
- Is there an issue with parsing of robots.txt? HOT 4
- Microdata: Underlying lib does not honour "content" attribute on all tags HOT 2
- Relative URLs HOT 1
- using cache to store metadata for frequently used urls HOT 1
- How to handle error when host does not respond? HOT 1
- Possible to add 'keywords' to 'clutteredMeta' object? HOT 1
- Receiving HTTPError: 403 from Shopify Sites HOT 2
- JSON-LD content embedded in CDATA not parsed
- Scraping foreign language site returns gibberish in metadata HOT 2
- Not returning Open graph details in certain websites
- ⚠️ Self-closing tags get corrupted 🚨 HOT 4
- Getting this issue : Error: Cannot find module 'preq' HOT 2
- passing url without http fails HOT 2
- How can I use this module for ES6 js ?
- Add some CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-metadata.