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