firecrawl 2.7.1__py3-none-any.whl → 2.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of firecrawl might be problematic. Click here for more details.
- firecrawl/__init__.py +1 -1
- firecrawl/__tests__/v1/e2e_withAuth/test.py +25 -0
- firecrawl/firecrawl.py +82 -16
- {firecrawl-2.7.1.dist-info → firecrawl-2.10.0.dist-info}/LICENSE +0 -0
- {firecrawl-2.7.1.dist-info → firecrawl-2.10.0.dist-info}/METADATA +1 -1
- firecrawl-2.10.0.dist-info/RECORD +12 -0
- {firecrawl-2.7.1.dist-info → firecrawl-2.10.0.dist-info}/top_level.txt +0 -2
- build/lib/build/lib/firecrawl/__init__.py +0 -79
- build/lib/build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- build/lib/build/lib/firecrawl/__tests__/e2e_withAuth/test.py +0 -170
- build/lib/build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- build/lib/build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py +0 -440
- build/lib/build/lib/firecrawl/firecrawl.py +0 -4467
- build/lib/build/lib/tests/test_change_tracking.py +0 -98
- build/lib/firecrawl/__init__.py +0 -79
- build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- build/lib/firecrawl/__tests__/e2e_withAuth/test.py +0 -170
- build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py +0 -440
- build/lib/firecrawl/firecrawl.py +0 -4467
- build/lib/tests/test_change_tracking.py +0 -98
- firecrawl-2.7.1.dist-info/RECORD +0 -26
- {firecrawl-2.7.1.dist-info → firecrawl-2.10.0.dist-info}/WHEEL +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
from unittest.mock import patch, MagicMock
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
from firecrawl import FirecrawlApp
|
|
6
|
-
|
|
7
|
-
class TestChangeTracking(unittest.TestCase):
|
|
8
|
-
@patch('requests.post')
|
|
9
|
-
def test_change_tracking_format(self, mock_post):
|
|
10
|
-
mock_response = MagicMock()
|
|
11
|
-
mock_response.status_code = 200
|
|
12
|
-
mock_response.json.return_value = {
|
|
13
|
-
'success': True,
|
|
14
|
-
'data': {
|
|
15
|
-
'markdown': 'Test markdown content',
|
|
16
|
-
'changeTracking': {
|
|
17
|
-
'previousScrapeAt': '2023-01-01T00:00:00Z',
|
|
18
|
-
'changeStatus': 'changed',
|
|
19
|
-
'visibility': 'visible'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
mock_post.return_value = mock_response
|
|
24
|
-
|
|
25
|
-
app = FirecrawlApp(api_key=os.environ.get('TEST_API_KEY', 'dummy-api-key-for-testing'))
|
|
26
|
-
result = app.scrape_url('https://example.com', {
|
|
27
|
-
'formats': ['markdown', 'changeTracking']
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
args, kwargs = mock_post.call_args
|
|
31
|
-
self.assertEqual(kwargs['json']['formats'], ['markdown', 'changeTracking'])
|
|
32
|
-
|
|
33
|
-
self.assertEqual(result['changeTracking']['previousScrapeAt'], '2023-01-01T00:00:00Z')
|
|
34
|
-
self.assertEqual(result['changeTracking']['changeStatus'], 'changed')
|
|
35
|
-
self.assertEqual(result['changeTracking']['visibility'], 'visible')
|
|
36
|
-
|
|
37
|
-
@patch('requests.post')
|
|
38
|
-
def test_change_tracking_options(self, mock_post):
|
|
39
|
-
mock_response = MagicMock()
|
|
40
|
-
mock_response.status_code = 200
|
|
41
|
-
mock_response.json.return_value = {
|
|
42
|
-
'success': True,
|
|
43
|
-
'data': {
|
|
44
|
-
'markdown': 'Test markdown content',
|
|
45
|
-
'changeTracking': {
|
|
46
|
-
'previousScrapeAt': '2023-01-01T00:00:00Z',
|
|
47
|
-
'changeStatus': 'changed',
|
|
48
|
-
'visibility': 'visible',
|
|
49
|
-
'diff': {
|
|
50
|
-
'text': '@@ -1,1 +1,1 @@\n-old content\n+new content',
|
|
51
|
-
'json': {
|
|
52
|
-
'files': [{
|
|
53
|
-
'from': None,
|
|
54
|
-
'to': None,
|
|
55
|
-
'chunks': [{
|
|
56
|
-
'content': '@@ -1,1 +1,1 @@',
|
|
57
|
-
'changes': [{
|
|
58
|
-
'type': 'del',
|
|
59
|
-
'content': '-old content',
|
|
60
|
-
'del': True,
|
|
61
|
-
'ln': 1
|
|
62
|
-
}, {
|
|
63
|
-
'type': 'add',
|
|
64
|
-
'content': '+new content',
|
|
65
|
-
'add': True,
|
|
66
|
-
'ln': 1
|
|
67
|
-
}]
|
|
68
|
-
}]
|
|
69
|
-
}]
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
'json': {
|
|
73
|
-
'title': {
|
|
74
|
-
'previous': 'Old Title',
|
|
75
|
-
'current': 'New Title'
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
mock_post.return_value = mock_response
|
|
82
|
-
|
|
83
|
-
app = FirecrawlApp(api_key=os.environ.get('TEST_API_KEY', 'dummy-api-key-for-testing'))
|
|
84
|
-
result = app.scrape_url('https://example.com', {
|
|
85
|
-
'formats': ['markdown', 'changeTracking'],
|
|
86
|
-
'changeTrackingOptions': {
|
|
87
|
-
'modes': ['git-diff', 'json'],
|
|
88
|
-
'schema': {'type': 'object', 'properties': {'title': {'type': 'string'}}}
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
args, kwargs = mock_post.call_args
|
|
93
|
-
self.assertEqual(kwargs['json']['formats'], ['markdown', 'changeTracking'])
|
|
94
|
-
self.assertEqual(kwargs['json']['changeTrackingOptions']['modes'], ['git-diff', 'json'])
|
|
95
|
-
|
|
96
|
-
self.assertEqual(result['changeTracking']['diff']['text'], '@@ -1,1 +1,1 @@\n-old content\n+new content')
|
|
97
|
-
self.assertEqual(result['changeTracking']['json']['title']['previous'], 'Old Title')
|
|
98
|
-
self.assertEqual(result['changeTracking']['json']['title']['current'], 'New Title')
|
firecrawl-2.7.1.dist-info/RECORD
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
build/lib/build/lib/firecrawl/__init__.py,sha256=jAxgyVgi4Aq94lwkcicF2_Ba2Y9u51-KfskU9d7ynRQ,2612
|
|
2
|
-
build/lib/build/lib/firecrawl/firecrawl.py,sha256=fsKXa1cHcIIsGUbFAENLlKYZaW349CHQ6O353Uq6ypg,190196
|
|
3
|
-
build/lib/build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
build/lib/build/lib/firecrawl/__tests__/e2e_withAuth/test.py,sha256=-Fq2vPcMo0iQi4dwsUkkCd931ybDaTxMBnZbRfGdDcA,7931
|
|
5
|
-
build/lib/build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
build/lib/build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py,sha256=DcCw-cohtnL-t9XPekUtRoQrgg3UCWu8Ikqudf9ory8,19880
|
|
7
|
-
build/lib/build/lib/tests/test_change_tracking.py,sha256=_IJ5ShLcoj2fHDBaw-nE4I4lHdmDB617ocK_XMHhXps,4177
|
|
8
|
-
build/lib/firecrawl/__init__.py,sha256=jAxgyVgi4Aq94lwkcicF2_Ba2Y9u51-KfskU9d7ynRQ,2612
|
|
9
|
-
build/lib/firecrawl/firecrawl.py,sha256=fsKXa1cHcIIsGUbFAENLlKYZaW349CHQ6O353Uq6ypg,190196
|
|
10
|
-
build/lib/firecrawl/__tests__/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
build/lib/firecrawl/__tests__/e2e_withAuth/test.py,sha256=-Fq2vPcMo0iQi4dwsUkkCd931ybDaTxMBnZbRfGdDcA,7931
|
|
12
|
-
build/lib/firecrawl/__tests__/v1/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
build/lib/firecrawl/__tests__/v1/e2e_withAuth/test.py,sha256=DcCw-cohtnL-t9XPekUtRoQrgg3UCWu8Ikqudf9ory8,19880
|
|
14
|
-
build/lib/tests/test_change_tracking.py,sha256=_IJ5ShLcoj2fHDBaw-nE4I4lHdmDB617ocK_XMHhXps,4177
|
|
15
|
-
firecrawl/__init__.py,sha256=jAxgyVgi4Aq94lwkcicF2_Ba2Y9u51-KfskU9d7ynRQ,2612
|
|
16
|
-
firecrawl/firecrawl.py,sha256=fsKXa1cHcIIsGUbFAENLlKYZaW349CHQ6O353Uq6ypg,190196
|
|
17
|
-
firecrawl/__tests__/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
firecrawl/__tests__/e2e_withAuth/test.py,sha256=-Fq2vPcMo0iQi4dwsUkkCd931ybDaTxMBnZbRfGdDcA,7931
|
|
19
|
-
firecrawl/__tests__/v1/e2e_withAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
firecrawl/__tests__/v1/e2e_withAuth/test.py,sha256=DcCw-cohtnL-t9XPekUtRoQrgg3UCWu8Ikqudf9ory8,19880
|
|
21
|
-
tests/test_change_tracking.py,sha256=_IJ5ShLcoj2fHDBaw-nE4I4lHdmDB617ocK_XMHhXps,4177
|
|
22
|
-
firecrawl-2.7.1.dist-info/LICENSE,sha256=nPCunEDwjRGHlmjvsiDUyIWbkqqyj3Ej84ntnh0g0zA,1084
|
|
23
|
-
firecrawl-2.7.1.dist-info/METADATA,sha256=w6FnQdZopA66KHPgwSziV2uhom9Unr6-5iyQ1RpTlog,7165
|
|
24
|
-
firecrawl-2.7.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
25
|
-
firecrawl-2.7.1.dist-info/top_level.txt,sha256=ytN_R30g2U2qZYFyIm710Z8QeK9FO1Uwa-WPGHXyqjE,27
|
|
26
|
-
firecrawl-2.7.1.dist-info/RECORD,,
|
|
File without changes
|