johntitus / node-horseman

Run PhantomJS from Node
MIT License
1.45k stars 124 forks source link

jQuery detect false-positive #297

Open jturner869 opened 7 years ago

jturner869 commented 7 years ago

I'm trying to scrape this web page: https://www.manheim.com/login?WT.svl=m_hdr_gnav_login

When I do this horseman does not load jQuery because it thinks jQuery is already loaded, because the site is already using $ for another function.

At first I thought it would be a good idea to make the jQuery detection more robust by doing a jQuery version lookup and parsing the jQuery name out. However that's problematic because jQuery would simply overwrite that function. SO that functionality is not a good default behavior, which lead me to the thought that horseman should allow a forced jQuery injection without checking to see if it is there, as well as the ability to initiate a force jQuery injection anywhere in the action chain. That way the user can decide if it is appropriate to overwrite the $ function.

awlayton commented 7 years ago

I would be willing to accept a PR to add "forced" jQuery injection. I am not sure if I'll have time to add it myself.

JamesRBrown commented 7 years ago

I think this would be a great idea. I've never contributed to a GitHub project before, but I'd be happy to work on the feature.