Comments (4)
Hello Elias,
I did not know playright before. Works fine for bypassing js wall ! Thanks a million
from advertools.
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.
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.
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):
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)
- Getting NaN values for serp_goog function HOT 3
- File not found on crawl method HOT 4
- opening .jl file command doesn't show 'my_output_file.jl' HOT 7
- crawl dataFrame - jsonld objects HOT 2
- Suggestion - don't treat jsonld items in distinct script tags as distinct. HOT 8
- How to get initial url in output.jl ? HOT 2
- Bypass protection HOT 3
- Need some way to rate limit requests for sitemap_to_df HOT 3
- Scraps forever HOT 3
- Feature Request - Alternative Crawl Output HOT 5
- Python 3.10/11 SSL: SSLV3_ALERT_HANDSHAKE_FAILURE HOT 5
- Advertools in Ubuntu in a Venv (Python 3.10.12 and Python 3.9.18) HOT 7
- browser can get https://zapier.com but when run scrape failed HOT 2
- logs_to_df() Limitation HOT 5
- Pandas Futurewarning "fillna" in url_to_df() HOT 1
- request_url_df creates wide list? HOT 3
- How to get started with development? HOT 7
- Instagram Mentions Allows Periods HOT 1
- about this result in serp HOT 3
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 advertools.