# Quora — Data Extraction `https://www.quora.com` — Q&A platform. One reliable access path: `http_get` with a Chrome UA against question, answer, topic, and profile pages. Quora SSR-renders all public data into `window.ansFrontendGlobals.data.inlineQueryResults` via `.push()` calls. No browser needed for read-only tasks. ## Do this first: pick your access path | Goal | Best approach | Latency | |------|--------------|---------| | Question metadata + first ~3 ranked answers | `http_get` question page + parse push payloads | ~600ms | | Single answer (full text + upvotes + views) | `http_get` answer permalink | ~400ms | | Answer count for a question | question page, payload with `answerCount` | same request as above | | Topic metadata (id, name, follower count) | `http_get` topic page + parse push payloads | ~400ms | | User profile (name, follower/following, credential) | `http_get` profile page + parse push payloads | ~500ms | | Keyword search results | NOT available via http_get — server returns no result data | N/A | **Never use a browser for read-only Quora tasks.** All question, answer, topic, and profile data is server-rendered. Browser is only needed for authenticated actions (posting, upvoting, following) or for getting more than the first ~3 answers on a question page (the rest load via XHR pagination). --- ## UA requirement: Chrome or Firefox — NOT bare Mozilla/5.0 ``` bare "Mozilla/5.0" -> HTTP 403 Googlebot UA -> HTTP 403 Chrome UA -> HTTP 200 (confirmed working) Firefox UA -> HTTP 200 (confirmed working) ``` Use this header bundle for all requests: ```python import urllib.request, gzip, json, re CHROME_UA = ( "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " "AppleWebKit/537.36 (KHTML, like Gecko) " "Chrome/123.0.0.0 Safari/537.36" ) def quora_get(url): """Fetch any public Quora page. Returns HTML string. Requires Chrome/Firefox UA — bare Mozilla/5.0 returns 403. """ req = urllib.request.Request(url, headers={ "User-Agent": CHROME_UA, "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding": "gzip", "Accept-Language": "en-US,en;q=0.9", }) with urllib.request.urlopen(req, timeout=20) as r: data = r.read() if r.headers.get("Content-Encoding") == "gzip": data = gzip.decompress(data) return data.decode() ``` --- ## The data format: `ansFrontendGlobals.data.inlineQueryResults` Quora SSR embeds all page data as a series of `.push("...")` calls inside `