Code Monkey home page Code Monkey logo

Comments (4)

caroheymes avatar caroheymes commented on May 24, 2024 1

Hello Elias,
I did not know playright before. Works fine for bypassing js wall ! Thanks a million

from advertools.

eliasdabbas avatar eliasdabbas commented on May 24, 2024

Thanks @caroheymes

Indeed I haven't seen your previous issue. Not sure why. Sorry!

As a quick check, I just tried to crawl with advertools, and it seems OK (I tested 100 pages)

Here is the sample file:

https://docs.google.com/spreadsheets/d/12E-Sq3mELZPBS3RwZuyev3t5ClHBCQiAqIzNgvuPm4I

I didn't dig deep into the page, but it seems there is some JS causing the popup, and then it's blocking the page. But on the live website it works properly as in the shared file.

Just curious, why do you want to view it offline?

from advertools.

caroheymes avatar caroheymes commented on May 24, 2024

Hello Elias, thanks for your feedback.
I am building a streamlit app to benchmark competitors prices.

Everyday, agents visit & collect the prices of different players and push the data in bigquery.

I need also to identify which products are unavailable. I've tried several xpath cf example below and defintely, I thing that I am blocked by the cookie wall (cf view response in scrapy)

urls = 'https://www.interflora.fr/p/roses-passion' output_file_details = 'export.jl' adv.crawl(url_list = urls, output_file=output_file_details, xpath_selectors={'button' : '//span[@data-test-id = "button-add-to-cart"].text()'}, custom_settings={'ROBOTSTXT_OBEY': False, 'DOWNLOAD_DELAY' : 1, 'USER_AGENT':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36'} df = pd.read_json(output_file_details, lines=True) df.columns => Float64Index([], dtype='float64')
the ld+json is unfortunately not enough

Thanks for your feedback

from advertools.

eliasdabbas avatar eliasdabbas commented on May 24, 2024

I think your selector is correct. But it seems this button is generated through some JS because its value is dynamic. I can't find it in the page source (but it's there when you inspect the element):

Screenshot 2024-02-10 at 11 37 44 AM

The word "épuisé" is itself épuisé :)

Checkout playwright maybe or other solutions. I'm thinking of options to tackle such situations.
Hope this makes sense.

from advertools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.