Skip to content

Commit 6546393

Browse files
kgriteshclaude
andcommitted
docs: Update README with comprehensive search_posts documentation
- Added search_posts example in Python Library section with updated output - Included all new fields: post_time (ISO 8601), links, media_urls, comments - Added CLI examples for search-posts command with all parameters - Removed duplicate/outdated search_posts example - Updated output samples to reflect current implementation - Showed markdown format for post_text and comment_text - Documented external links filtering behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 38acdbb commit 6546393

File tree

1 file changed

+56
-26
lines changed

1 file changed

+56
-26
lines changed

README.md

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,42 @@ results = scraper.search_profiles("software engineer", max_results=10)
9595
]
9696
```
9797

98+
```python
99+
# Search for posts by keywords
100+
posts = scraper.search_posts("artificial intelligence", max_results=10, scroll_pause=2.0)
101+
```
102+
103+
**Output sample:**
104+
105+
```json
106+
[
107+
{
108+
"author_name": "John Doe",
109+
"author_headline": "AI Research Scientist at OpenAI",
110+
"author_profile_url": "https://linkedin.com/in/johndoe",
111+
"connection_degree": "2nd",
112+
"post_time": "2024-01-15T14:30:00+00:00",
113+
"post_text": "Excited to share our latest research on [large language models](https://example.com/paper)...",
114+
"hashtags": ["#AI", "#MachineLearning", "#Research"],
115+
"links": ["https://example.com/paper"],
116+
"post_url": "https://linkedin.com/feed/update/urn:li:activity:123456789",
117+
"media_urls": ["https://media.licdn.com/dms/image/..."],
118+
"likes_count": 1247,
119+
"comments_count": 89,
120+
"reposts_count": 234,
121+
"comments": [
122+
{
123+
"author_name": "Jane Smith",
124+
"author_profile_url": "https://linkedin.com/in/janesmith",
125+
"comment_text": "Great insights! Looking forward to reading the full paper.",
126+
"comment_time": "2024-01-15T15:45:00+00:00",
127+
"reactions_count": 12
128+
}
129+
]
130+
}
131+
]
132+
```
133+
98134
```python
99135
# Scrape individual profile
100136
profile = scraper.scrape_profile("https://linkedin.com/in/someone")
@@ -148,32 +184,6 @@ company = scraper.scrape_company("https://linkedin.com/company/tech-corp")
148184
}
149185
```
150186

151-
```python
152-
# Search for posts by keywords
153-
posts = scraper.search_posts("artificial intelligence", max_results=10)
154-
```
155-
156-
**Output sample:**
157-
158-
```json
159-
[
160-
{
161-
"author_name": "John Doe",
162-
"author_headline": "AI Research Scientist at OpenAI",
163-
"author_profile_url": "https://linkedin.com/in/johndoe",
164-
"connection_degree": "2nd",
165-
"post_time": "2d",
166-
"post_text": "Excited to share our latest research on large language models...",
167-
"hashtags": ["#AI", "#MachineLearning", "#Research"],
168-
"post_url": "https://linkedin.com/feed/update/urn:li:activity:123456789",
169-
"image_url": "https://media.licdn.com/dms/image/...",
170-
"likes_count": 1247,
171-
"comments_count": 89,
172-
"reposts_count": 234
173-
}
174-
]
175-
```
176-
177187
```python
178188
# Don't forget to clean up
179189
scraper.close()
@@ -187,15 +197,35 @@ Great for quick data extraction and scripting:
187197

188198
```bash
189199
# If installed via pip
200+
# Search for profiles
190201
linkedin-spider-cli search -q "product manager" -n 10 -o results.json --email your@email.com --password yourpassword
202+
203+
# Search for posts
204+
linkedin-spider-cli search-posts -k "artificial intelligence" -n 10 -s 2.0 -o posts.json --email your@email.com --password yourpassword
205+
206+
# Scrape individual profile
191207
linkedin-spider-cli profile -u "https://linkedin.com/in/johndoe" -o profile.json --email your@email.com --password yourpassword
208+
209+
# Scrape company
192210
linkedin-spider-cli company -u "https://linkedin.com/company/openai" -o company.json --email your@email.com --password yourpassword
211+
212+
# Get connection requests
193213
linkedin-spider-cli connections -n 20 -o connections.json --email your@email.com --password yourpassword
194214

195215
# If using development setup
216+
# Search for profiles
196217
uv run linkedin-spider-cli search -q "product manager" -n 10 -o results.json --email your@email.com --password yourpassword
218+
219+
# Search for posts
220+
uv run linkedin-spider-cli search-posts -k "artificial intelligence" -n 10 -s 2.0 -o posts.json --email your@email.com --password yourpassword
221+
222+
# Scrape individual profile
197223
uv run linkedin-spider-cli profile -u "https://linkedin.com/in/johndoe" -o profile.json --email your@email.com --password yourpassword
224+
225+
# Scrape company
198226
uv run linkedin-spider-cli company -u "https://linkedin.com/company/openai" -o company.json --email your@email.com --password yourpassword
227+
228+
# Get connection requests
199229
uv run linkedin-spider-cli connections -n 20 -o connections.json --email your@email.com --password yourpassword
200230
```
201231

0 commit comments

Comments
 (0)