Commit Graph

49 Commits

Author SHA1 Message Date
Karim shoair e5a022ec6a fix(parser): Improving CSS selecting memory usage by ~144%
and speed by ~2%
2025-03-16 22:33:46 +02:00
Karim shoair 94909099a9 fix(Parser): Change default text content to empty string instead of None
For compatibility with previous fix/commit
2025-03-15 00:56:19 +02:00
Karim shoair 3d2418b67a feat(Fetcher): Add the redirections history to Fetcher
Feature requested in #32
2025-02-22 16:58:54 +02:00
Karim shoair 390bd51cb1 fix(TextHandler): correcting case_sensitive argument logic
This is awkward, I can't believe how this slipped from me!
2025-02-22 15:20:11 +02:00
Karim shoair 7c35341d85 refactor(parser/get_all_text): Cleaner and a bit faster implementation 2025-01-31 02:47:49 +02:00
Karim shoair a6fd25f64c fix(parser): fix traverse selectors 2025-01-31 01:57:19 +02:00
Karim shoair a8d475afb0 feat(parser): Make all returned html as TextHandler
So you can do regex on raw html if wanted etc...
2025-01-31 01:38:48 +02:00
Karim shoair 3330e9f475 refactor(parser/automatch): Cleaner and faster implementation
~5% speed boost
2025-01-31 01:34:02 +02:00
Karim shoair 37a31a120e refactor(parser/find_by_regex): Better implementation for ~60% speed boost 2025-01-31 01:19:11 +02:00
Karim shoair 2c6142d96d refactor(parser/find_by_text): Better implementation for ~20% speed boost 2025-01-31 01:12:00 +02:00
Karim shoair 1962c11f64 fix(parser/find_all): Logic issues made conditions used sometimes in a (and) fashion and other times (OR)
Also, the speed boost is 6-14% not 95% as I said first :(
2025-01-31 00:23:54 +02:00
Karim shoair 57090f90a4 refactor(parser/find_all): about ~95% speed increase
Boom!
2025-01-30 23:39:46 +02:00
Karim shoair f37538320f feat(parser): adding below_elements method 2025-01-30 23:05:10 +02:00
Karim shoair e507778c48 feat(Parser): Set regex methods new return types as TextHandlers 2025-01-30 02:27:38 +02:00
Karim shoair 4e2e7a4b22 fix(parser): More on correcting type hints and unifying return type 2025-01-30 02:03:09 +02:00
Karim shoair 7ee0f6114d fix(parser): Code restructure for speed boost & better type hints
- Now return types are consistent across all the parser engine
- Parser got a 5-30% performance boost across different methods.
- Renamed some of the internal methods for clearer code.
- A lot better auto-completion experience after a lot of adjustments.
2025-01-30 01:46:33 +02:00
Karim shoair 3cca3fd56b style(parser): more accurate type hints 2024-12-21 16:17:02 +02:00
Karim shoair 6652b8ac18 fix: solve the response log issue so now you get log for every response from Fetchers 2024-12-19 12:29:34 +02:00
Karim shoair 838b8b1196 style: fixing a typo in logging 2024-12-16 13:39:30 +02:00
Karim shoair 193827e27b refactor(api)!: Unifying log under 1 logger and removing debug parameter
So now you control the logging and the debugging from the shell through the logger with the name 'scrapling'
2024-12-11 21:41:37 +02:00
Karim shoair dcf51876a5 fix: Adaptor.body returns raw HTML without processing
If possible, otherwise returns `Adaptor.html_content`
2024-12-11 20:18:05 +02:00
Karim shoair b4f90615c3 Adding keep_cdata argument for Adaptor and Response classes
This will force lxml to keep cdata while parsing html if you want
2024-12-10 22:06:08 +02:00
Karim shoair 5f9c3980dc Adding urljoin method to Adaptors and Responses 2024-12-10 22:02:43 +02:00
Karim shoair 45e86f50a3 Adding empty methods (get/get_all/extract/extract_all)
For easy copy-paste from Scrapy/parsel code when needed :)
2024-12-04 14:28:37 +02:00
Karim shoair 1a17b2ce46 Sorting all library imports with isort 2024-11-30 14:02:06 +02:00
Karim shoair 572df6b3b4 Fixing the way Response object handles sub items in some edge cases
+ Do it with the least impact on performance
2024-11-16 13:54:55 +02:00
Karim shoair b0c2b1818b Return to the default text behaviour
The logic to remove comment tags before returning text was causing errors sometimes so from now on leave `keep_comments` set to True better as it is.
2024-11-14 22:21:45 +02:00
Karim shoair eaa7da27c6 Better logic to handle json responses 2024-11-14 00:03:26 +02:00
Karim shoair d4b896b4e9 Parser - New logic to handle JSON responses passed from Fetchers 2024-11-13 23:14:27 +02:00
Karim shoair 4b2814404a Fixing the functions-based filtering logic 2024-11-09 22:32:05 +02:00
Karim shoair 6b62579a7e Making find_all/find methods on steroids
Adding the ability to find elements by regex patterns and functions.
2024-11-09 21:25:17 +02:00
Karim shoair b919536527 Updating the keywords whitelisting logic in find/find_all functions 2024-11-07 12:56:32 +02:00
Karim shoair 91f6b46e6d Adding new filter and search functions to parser 2024-11-07 00:31:14 +02:00
Karim shoair b25d2ee79b Adding new find_all and find functions to parser 2024-11-07 00:01:14 +02:00
Karim shoair 6b40af426f Better logic for css_first and xpath_first 2024-11-06 22:14:33 +02:00
Karim shoair 5e848ef046 Adding new class type TextHandlers 2024-11-06 21:03:19 +02:00
Karim shoair 7a84511b7a Making Adaptor and Adaptor re/re_first arguments consistent with the TextHandler ones 2024-11-06 20:47:21 +02:00
Karim shoair 7af75f78a5 Better logic for Adaptors re_first method 2024-11-06 20:24:30 +02:00
Karim shoair 5548941cf1 Correcting return type for css_first and xpath_first 2024-11-06 12:28:43 +02:00
Karim shoair 3622040440 Adding css_first and xpath_first for easier usage 2024-11-05 23:41:51 +02:00
Karim shoair 009c2914aa Fixing re_first logic in Adaptors type 2024-11-05 22:59:47 +02:00
Karim shoair eaae5908c9 Make auto_match enabled by default 2024-11-03 13:33:24 +02:00
Karim shoair 942aa08c85 Handling JSON responses better 2024-11-03 13:00:23 +02:00
Karim shoair 145c03daff Big structure changes (check commit description)
- Moved most of the parser functions/files to the core package.
- Converted tools file to a package and made separate files for similar functions.
- Now all fetcher engines return a Response object
- Instead of selecting an engine to use and passing config to it, we have separate fetcher classes so the user can choose what to use while importing.
- I added a new custom fetcher so the user can create and use an engine.
- More...
2024-11-03 01:04:02 +02:00
Karim shoair 23c4181ff2 Using the new types file 2024-10-31 01:32:18 +03:00
Karim shoair d546b3499b Handling an edge case and adding more commentary 2024-10-16 19:32:01 +03:00
Karim shoair a01cfe66db Version 0.1.2
Check the changelog in releases
2024-10-16 18:21:56 +03:00
Karim shoair 84b0ea6121 Handle importing SupportsIndex in Python 3.6 and 3.7 2024-10-14 00:04:36 +03:00
Karim shoair a721073b7c Going online (first public version) 2024-10-13 23:38:48 +03:00