1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "scrapeDepth": "detail",
10 "searchQueries": ["python programming"],
11 "resultTypes": [
12 "question",
13 "answer",
14 "profile",
15 "profile_activity",
16 "topic",
17 "space",
18 "post",
19 "search_result",
20 ],
21 "onlyUnanswered": False,
22 "excludePromoted": False,
23 "includePromoted": True,
24 "includePromotionEvidence": True,
25 "includeUncertain": True,
26 "maxResults": 10,
27 "maxResultsPerQuery": 10,
28 "includeFieldEvidence": True,
29 "maxItems": 0,
30 "maxItemsPerSource": 0,
31 "maxItemsPerQuery": 0,
32 "requestDelay": 2,
33 "maxNavigationRetries": 1,
34 "maxAnswersPerQuestion": 10,
35 "minAnswerUpvotes": 0,
36 "minUpvotes": 0,
37 "filterAiAnswers": "include",
38 "topCommentsOnly": False,
39 "maxScrollAttempts": 8,
40 "includeAnswers": True,
41 "includeMedia": True,
42 "includeOutboundLinks": True,
43 "includeAnswerHtml": True,
44 "includeHtmlContent": True,
45 "includeRelatedQuestions": True,
46 "maxRelatedQuestions": 0,
47 "includeQuestionTopics": True,
48 "maxQuestionTopics": 0,
49 "includeTopicQuestions": True,
50 "maxTopicQuestions": 20,
51 "includeTopicPosts": False,
52 "maxTopicPosts": 20,
53 "includeRelatedTopics": True,
54 "maxRelatedTopics": 20,
55 "includeAnswerPreview": False,
56 "maxAnswerPreviews": 3,
57 "minAnswerPreviewUpvotes": 0,
58 "includeSpaceSettings": False,
59 "includeQuestionDetails": True,
60 "includeQuestionHtml": False,
61 "maxQuestionHtmlBytes": 0,
62 "maxAnswerHtmlBytes": 0,
63 "maxPostHtmlBytes": 0,
64 "includePostHtml": False,
65 "maxPostsPerSource": 0,
66 "includeComments": False,
67 "includePostComments": False,
68 "maxCommentsPerPost": 10,
69 "includeEngagementBreakdown": False,
70 "includeReactionBreakdown": False,
71 "includeRelatedContent": False,
72 "maxRelatedContent": 10,
73 "includePostAuthorContext": False,
74 "maxPostAuthorContextItems": 10,
75 "maxCommentsPerAnswer": 10,
76 "maxReplyExpandAttempts": 0,
77 "includeProfileActivity": False,
78 "includeProfileSensitiveFields": True,
79 "includeSensitiveProfileFields": True,
80 "includeSocialLinks": True,
81 "activityTab": "all",
82 "includeActivityText": True,
83 "includeActivityHtml": False,
84 "maxItemsPerTab": 0,
85 "maxDetailItems": 0,
86 "maxAuthors": 1000,
87 "maxSourcePages": 100,
88 "maxEvidencePerAuthor": 10,
89 "includeProfileSnapshot": False,
90 "includeEntityGraph": False,
91 "includeGraphEdges": False,
92 "maxGraphEdges": 1000,
93 "profileActivityTypes": [
94 "answer",
95 "question",
96 "post",
97 ],
98 "maxProfileActivityItems": 20,
99 "onlyNewItems": False,
100 "includeUnchanged": True,
101 "cookies": [],
102 "proxyConfiguration": {
103 "useApifyProxy": True,
104 "apifyProxyGroups": ["RESIDENTIAL"],
105 },
106}
107
108
109run = client.actor("crawlerbros/quora-search-scraper").call(run_input=run_input)
110
111
112print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
113for item in client.dataset(run.default_dataset_id).iterate_items():
114 print(item)
115
116