<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mert Bekci on Medium]]></title>
        <description><![CDATA[Stories by Mert Bekci on Medium]]></description>
        <link>https://medium.com/@mertbekci?source=rss-7f9382fa1e37------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*62VyKwzHrLyy9zpCT-hHHg.jpeg</url>
            <title>Stories by Mert Bekci on Medium</title>
            <link>https://medium.com/@mertbekci?source=rss-7f9382fa1e37------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:13:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mertbekci/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[We built a free, open-source API client. Come break it with us.]]></title>
            <link>https://mertbekci.medium.com/we-built-a-free-open-source-api-client-come-break-it-with-us-b2ffb90747b1?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2ffb90747b1</guid>
            <category><![CDATA[api-client]]></category>
            <category><![CDATA[free]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[alternative]]></category>
            <category><![CDATA[postman]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 08:01:01 GMT</pubDate>
            <atom:updated>2026-04-18T08:01:01.606Z</atom:updated>
            <content:encoded><![CDATA[<p>Every API client we tried wanted something in return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjpZ-n-If0BjaLQ2W5Gkxg.png" /></figure><p>Postman caps free history at 25 requests and locks OAuth2 behind $19 per seat. Bruno nailed the local-first model, but SSE connections hang forever, large responses crash the UI, and cookies vanish between restarts — all open issues, no fix date. Then Kong acquired Insomnia and forced cloud sync on every user overnight. The local-first promise disappeared.</p><p>We kept switching tools, patching around limits, and losing session state between restarts. Eventually, we stopped patching and started building.</p><p>The result is <strong>Scrapeman</strong> — a desktop API client for macOS, Windows, and Linux. Apache 2.0. Free. Not “free tier with limits.” The whole thing, forever, no asterisk.</p><p>Source code: <a href="https://github.com/scrape-do/scrapeman?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=intro_repo">github.com/scrape-do/scrapeman</a><br>Website: <a href="https://scrapeman.app/">https://scrapeman.app/</a></p><h3>What you actually get</h3><p>No account to create. No cloud to trust. No feature is hidden behind “upgrade to unlock.”</p><p><strong>Unlimited request history.</strong> Stored as local JSONL files, template-preserving — {{token}} stays {{token}} on disk so your secrets are never baked into history.</p><p><strong>OAuth2 client credentials</strong> with automatic token caching and refresh. The token endpoint gets hit once, not once per concurrent request.</p><p><strong>AWS Signature v4</strong> signing, built in, not behind a paywall.</p><p><strong>A single-request load runner.</strong> Bounded concurrency, live p50/p95/p99 latency, status histogram, response validator. Stop mid-run and keep partial results. No separate tool, no cloud seat.</p><p><strong>Git-friendly YAML collections.</strong> One .req.yaml file per request, stable key order, clean diffs. Share via git, not a proprietary workspace.</p><p><strong>{{var}} autocomplete</strong> across URL, headers, body, auth, and proxy fields. Built-in dynamics like {{uuid}} and {{timestamp}} resolve fresh on every send.</p><p><strong>HTTP/2 toggle</strong> and <strong>native proxy support</strong> with per-request configuration.</p><p>Postman charges $19/seat/month for several of these. We ship all of them in a binary you install with one command:</p><pre>brew tap scrape-do/scrapeman &amp;&amp; brew install --cask scrapeman</pre><p>Or grab the DMG, EXE, or AppImage from the <a href="https://github.com/scrape-do/scrapeman/releases?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=install_releases">releases page</a>.</p><h3>Open source, for real</h3><p>Apache 2.0. Not “source-available.” Not “open core with a paid enterprise edition.” One license, no commercial restrictions.</p><p>Fork it. Rebrand it. Ship a derivative product. Run it inside your company. No permission needed, no CLA to sign.</p><p>The repo has 196 passing tests across 19 test files. The codebase is an Electron 33 + React + TypeScript monorepo with undici for HTTP, tough-cookie for the cookie jar, and aws4 for SigV4 signing. Every architectural decision is documented in the planning/ directory.</p><h3>What we do not have yet</h3><p>We are not going to hide the gaps behind a features page.</p><p>Scrapeman does not have GraphQL, WebSocket, or gRPC support today. There is no JavaScript scripting sandbox for pre-request or post-request hooks. There is no plugin system.</p><p>These are tracked as real tasks in the repo. If you care about any of them, you can wait for us to ship them, or you can get there first:</p><p><strong>Open contribution targets:</strong></p><ul><li>GraphQL body editor with schema introspection (T1202)</li><li>Request chaining via response variable capture (T1200)</li><li>Response diff viewer between history entries (T1201)</li><li>Postman Collection v2.1 import</li><li>Bruno .bru folder import</li></ul><p>The PR checklist is in the repo. Tests run on CI for macOS, Linux, and Windows.</p><h3>How it was built</h3><p>The entire codebase was vibe-coded. A human engineer made the architecture decisions and reviewed every difference. Claude Opus wrote the code and the tests.</p><p>The landing page went from zero to seven pages in a single session. We shipped wrong license claims in a competitor comparison page, used Postman’s marketing slogan as our own tagline for half a day, and lost a file during a parallel agent merge. All of it is in the git history. We did not clean it up.</p><p>196 tests pass. The app works. That is the deal with vibe coding: the pace is real, but you review everything, or you ship nonsense.</p><h3>See it for yourself</h3><p>We wrote a comparison page for every major API client, each with an honest “where they win” section. Pick yours:</p><ul><li><a href="https://scrapeman.app/postman-alternative?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=compare_postman">vs Postman</a> — what you gain when you stop paying $19/seat</li><li><a href="https://scrapeman.app/bruno-alternative?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=compare_bruno">vs Bruno</a> — four open bugs we already fixed</li><li><a href="https://scrapeman.app/insomnia-alternative?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=compare_insomnia">vs Insomnia</a> — local-first that no acquisition can take away</li><li><a href="https://scrapeman.app/hoppscotch-alternative?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=compare_hoppscotch">vs Hoppscotch</a> — native desktop, not a browser tab</li><li><a href="https://scrapeman.app/yaak-alternative?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=compare_yaak">vs Yaak</a> — Apache 2.0 with a company behind it</li><li><a href="https://scrapeman.app/features?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=features">All features</a></li></ul><p><a href="https://github.com/scrape-do/scrapeman?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=footer_star"><strong>Star Scrapeman on GitHub</strong></a></p><p>Something broken? <a href="https://github.com/scrape-do/scrapeman/issues?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=footer_issues">Open an issue.</a> Want to fix it yourself? <a href="https://github.com/scrape-do/scrapeman/pulls?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=launch_en&amp;utm_content=footer_prs">Send a PR.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2ffb90747b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[한국 웹 스크래핑의 핵심, 네이버를 뚫는 방법]]></title>
            <link>https://mertbekci.medium.com/%ED%95%9C%EA%B5%AD-%EC%9B%B9-%EC%8A%A4%ED%81%AC%EB%9E%98%ED%95%91%EC%9D%98-%ED%95%B5%EC%8B%AC-%EB%84%A4%EC%9D%B4%EB%B2%84%EB%A5%BC-%EB%9A%AB%EB%8A%94-%EB%B0%A9%EB%B2%95-deef701c04dd?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/deef701c04dd</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[naver-scraping]]></category>
            <category><![CDATA[naver-data-scraping]]></category>
            <category><![CDATA[naver]]></category>
            <category><![CDATA[naver-data-extraction]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Tue, 20 May 2025 10:49:01 GMT</pubDate>
            <atom:updated>2025-05-20T10:49:01.972Z</atom:updated>
            <content:encoded><![CDATA[<p>영문 원문 보러가기:<a href="https://scrape.do/blog/naver-scraping/"> https://scrape.do/blog/naver-scraping/</a></p><p>네이버는 한국에서 가장 중요한 검색 엔진이자 이커머스 플랫폼이며, 디지털 생태계까지 모두 통합한 서비스입니다.</p><p>한국 검색 시장의 <strong>60퍼센트 이상을 점유</strong>하고 있으며, 수많은 스마트스토어(네이버의 이커머스 플랫폼)를 구동하고 뉴스부터 결제까지 모든 것을 처리합니다.</p><p><em>한국 웹 데이터를 스크래핑하고 있다면, 언젠가는 반드시 네이버를 마주하게 됩니다.</em></p><p>하지만 네이버를 스크래핑하는 건 쉽지 않습니다.</p><h3>왜 대부분의 스크래퍼는 네이버에서 실패할까?</h3><h3>데이터센터 프록시는 즉시 차단됩니다</h3><p>네이버는 알려진 데이터센터 IP 대역에서 발생하는 접속을 적극적으로 차단합니다. 이 오류 페이지를 자주 보게 될 가능성이 높습니다:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/0*Otpo81LFyOikPG1o" /></figure><p>AWS, GCP 같은 클라우드 서비스나 상용 프록시를 사용하면, 거의 확실하게 다음과 같은 응답을 받게 됩니다:</p><ul><li>403 Forbidden — 요청이 아예 차단됨</li><li>429 Too Many Requests — 요청을 보내기도 전에 과도한 접근으로 제한됨</li><li>502 Bad Gateway — 웹 방화벽(WAF)이 개입할 때 자주 나타나는 오류</li></ul><p><strong>첫 페이지조차 열리지 않습니다.</strong></p><p>이를 피하려면, <strong>한국 인터넷 서비스 제공업체(ISP)를 통해 제공되는 주거용 또는 모바일 IP</strong>를 사용해야 하며, 접속 유지 기능과 <strong>주기적으로 변경되는 요청 헤더</strong>나 <strong>브라우저 식별 정보</strong>도 함께 적용해야 즉시 차단당하지 않습니다.</p><h3>자바스크립트 렌더링만으로는 충분하지 않습니다</h3><p>아무리 강력한 <strong>헤드리스 브라우저</strong>를 사용하더라도, 화면이 빈 상태로 남는 경우가 많습니다.</p><p>그 이유는 네이버가 <strong>복잡한 자바스크립트 기반 검증 절차</strong>를 여러 단계로 구성해 놓았기 때문입니다. 이 검증은 지역 정보나 접속자의 행동 패턴에 따라 다르게 작동합니다.</p><p>스크래핑 도구가 예상하는 동작 방식(브라우저 지문, 보안 연결 설정, 실행 타이밍 등)을 따르지 않으면, 페이지 렌더링은 조용히 실패하거나 끝없이 반복되기도 합니다.</p><p>일부 페이지는 200 OK 상태를 반환하고 정상적으로 로딩된 것처럼 보이지만, 실제 콘텐츠는 <strong>모든 스크립트가 정확한 순서로 실행되지 않으면</strong> 표시되지 않습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ctAPMyZzy4gh4G2q" /></figure><p>이것이 네이버의 특징입니다: <em>단순히 봇 여부만 확인하는 것이 아니라, </em><strong><em>한국 내 실제 사용자의 브라우징 행태</em></strong><em>를 그대로 재현하는지를 검증합니다.</em></p><h3>Scrape.do는 이 모든 문제를 어떻게 우회할까요?</h3><p>직접 설정을 통해 네이버를 스크래핑하려고 하면?</p><p>페이지가 로드되기도 전에 차단당할 가능성이 큽니다.</p><p>왜냐하면 네이버는 <em>접속 위치, 브라우저 동작 방식, 세션이 얼마나 자연스러운지</em> 등 <strong>모든 요소를 감시하기 때문</strong>입니다.</p><p><strong>최적화된 브라우저를 사용하더라도</strong>, 올바른 IP와 접속 환경 설정이 없으면 실패합니다.</p><p><a href="https://scrape.do/">Scrape.do</a>는 이 모든 과정을 자동으로 처리해줍니다.</p><ul><li><strong>한국 주거용 IP 사용 🇰🇷</strong></li><li><strong>세션 고정 유지 기능 📌</strong></li><li><strong>요청 헤더 및 브라우저 지문 자동 회전 🔄</strong></li><li><strong>자바스크립트 완전 렌더링 지원 🖼️</strong></li></ul><p>복잡한 설정이나 유지관리 없이, 스크래핑 대상 URL만 보내면 실제 페이지를 <strong>즉시 받아볼 수 있습니다.</strong></p><h3>제품 상세 페이지에서 네이버 상품 정보 추출하기</h3><p>가장 일반적인 방법은 바로 이겁니다: <strong>제품 상세 페이지에 직접 접근해서 상품명, 가격 등 핵심 정보를 추출</strong>하는 방식입니다.</p><p>이 방식은 <em>초기 차단을 우회할 수 있다면</em> 잘 작동합니다. 이번 튜토리얼에서는<a href="https://brand.naver.com/steelseries/products/11800715035"> SteelSeries 헤드셋 제품 페이지</a>를 대상으로 <strong>Python과 Scrape.do를 사용하여</strong> 스크래핑을 진행해보겠습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F_gKXOT8O3jTRhYz" /></figure><p>첫 요청을 보내기 전에 필요한 도구들을 준비합시다.</p><h3>준비물</h3><p>Python과 몇 가지 간단한 라이브러리를 사용할 것입니다:</p><ul><li>requests: HTTP 요청을 보냅니다</li><li>re: HTML 응답에서 필요한 정보를 정규표현식으로 추출합니다</li><li><strong>Scrape.do API 토큰</strong>: 차단 없이 페이지에 접근하려면 Scrape.do의 API 토큰이 필요합니다.<a href="https://dashboard.scrape.do/signup"> 여기에서 무료 가입</a>하면 <strong>1000 크레딧</strong>을 받을 수 있습니다.</li></ul><p>requests가 없다면 아래 명령어로 설치하세요:</p><p>pip install requests</p><h3>첫 번째 요청 보내기</h3><p>이제 실제 제품 페이지에 요청을 보내고, 정상적인 응답을 받을 수 있는지 확인해보겠습니다.</p><p>네이버의 경우 일반 IP는 빠르게 차단되므로, <strong>프리미엄 프록시 경로를 활성화하는 super=true</strong> 파라미터를 반드시 사용해야 합니다.</p><pre>import requests<br>import urllib.parse<br><br># Scrape.do 토큰 입력<br>token = &quot;&lt;your_token&gt;&quot;<br><br># 네이버 상품 URL<br>target_url = &quot;https://brand.naver.com/steelseries/products/11800715035&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br><br># super=true를 이용한 프리미엄 프록시 경로<br>url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># 요청 전송<br>response = requests.get(url)<br><br># 응답 상태 출력<br>print(response)<br><br>정상적으로 작동한다면 아래와 같은 결과가 나옵니다:<br>&lt;Response [200]&gt;</pre><p>즉, <strong>네이버 접근에 성공했고 데이터를 추출할 준비가 되었다는 의미입니다.</strong></p><h3>상품명과 가격 추출하기</h3><p>정상적인 응답을 받았다면, 이제 페이지 소스에서 상품명과 가격을 추출할 수 있습니다.</p><p>❗ 보통은 웹페이지에서 원하는 정보를 찾아 <strong>검사(Inspect)</strong> 기능으로 요소를 확인하지만, 이번엔 그렇게 안 됩니다.<br> **페이지 소스(View Page Source)**로 이동해서 직접 찾아야 합니다.</p><p>HTML 응답을 살펴보면, 네이버는 모든 상품 정보를 하나의 거대한 <strong>내부 JSON 객체</strong> 안에 삽입합니다.</p><p>여기에는 “dispName”(상품명), “dispDiscountedSalePrice”(할인가) 같은 정보가 포함되어 있습니다:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QdrIUugiNJOSVHC4" /></figure><p>전체 JSON을 파싱할 필요는 없습니다. <strong>정규표현식</strong>으로 간단히 해결할 수 있습니다.</p><pre>import requests<br>import urllib.parse<br>import re<br><br># Scrape.do 토큰 입력<br>token = &quot;&lt;your_token&gt;&quot;<br><br># 타겟 URL 인코딩<br>target_url = urllib.parse.quote_plus(&quot;https://brand.naver.com/steelseries/products/11800715035&quot;)<br><br># Scrape.do API 요청 경로<br>url = f&quot;https://api.scrape.do?token={token}&amp;url={target_url}&amp;super=true&quot;<br><br># 요청 전송<br>response = requests.get(url)<br><br># 응답 본문에서 정규표현식으로 정보 추출<br>html = response.text<br>product_name = re.search(r&#39;&quot;dispName&quot;:&quot;([^&quot;]+)&quot;&#39;, html).group(1)<br>discounted_price = int(re.search(r&#39;&quot;dispDiscountedSalePrice&quot;:([0-9]+)&#39;, html).group(1))<br><br># 결과 출력<br>print(&quot;Product Name:&quot;, product_name)<br>print(&quot;Price:&quot;, f&quot;{discounted_price:,}₩&quot;)<br><br>출력 결과는 다음과 비슷할 것입니다:<br>Product Name: [QcK Heavy M 증정] 스틸시리즈 Arctis Nova 5 무선 게이밍 헤드셋 - 블랙 / 화이트<br>Price: 176,000₩</pre><p>이렇게 해서 네이버 제품 한 건을 성공적으로 스크래핑했습니다!</p><p>하지만 이 방식은 종종 <strong>불안정하거나 일관성이 떨어질 수 있습니다.</strong></p><p><strong>네이버의 보안은 매우 강력하기 때문입니다.</strong></p><p>그래서 저는 조금 더 안정적인 대안으로 <strong>내부 API를 직접 호출하는 방식</strong>을 사용합니다.</p><h3>네이버 API 엔드포인트를 이용한 상품 정보 스크래핑</h3><p>좀 더 빠르고, 안정적이며, 파싱이 쉬운 방법을 찾고 있다면 네이버의 <strong>내부 API</strong>를 활용하는 것이 더 나은 선택입니다.<br> <strong>응답이 JSON 형식으로 깔끔하게 반환되고, 속도도 훨씬 빠르며 일관성도 높습니다.</strong></p><p><em>단 한 가지 문제는?</em></p><p><strong>API 요청을 직접 구성해야 한다는 점입니다.</strong></p><p>하지만 걱정하지 마세요. 생각보다 훨씬 간단합니다.</p><p>필요한 정보는 단 두 가지뿐입니다:</p><ul><li>channelUid: 브랜드 또는 판매자의 고유 ID</li><li>productNo: 상품 ID (상품 URL에 이미 포함되어 있음)</li></ul><p>그리고 대부분의 경우, 특정 스토어를 대상으로 스크래핑하기 때문에 이 channelUid는 <strong>여러 상품에 재사용</strong>할 수 있습니다.</p><p>먼저 이 값을 어떻게 찾는지 알아보겠습니다.</p><h3>channelUid 찾는 방법</h3><p>가장 쉬운 방법은 <strong>페이지 소스</strong>를 검사하는 것입니다.</p><p>상품 페이지에서 마우스 오른쪽 클릭 후 **”검사”**를 누르거나, F12 키를 누르세요.</p><p>개발자 도구에서 Ctrl + F를 누르고 아래와 같이 검색합니다:</p><p>channelUid</p><p>그럼 아래와 같은 텍스트가 보일 것입니다:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/0*P3GSUmP5425xkYY2" /></figure><p>이 값이 바로 우리가 찾던 channelUid입니다.</p><p>이 ID는 해당 스토어(예: SteelSeries) 고유의 값이며, 해당 브랜드의 <strong>모든 상품에 동일하게 적용됩니다.<br></strong> 한 번만 찾아두면, 같은 판매자의 수십 개 상품에 재활용할 수 있습니다.</p><h3>상품 ID 찾는 방법</h3><p><strong>이건 더 간단합니다.</strong></p><p>상품 URL을 보면 바로 나옵니다:</p><p><a href="https://brand.naver.com/steelseries/products/11800715035">https://brand.naver.com/steelseries/products/11800715035</a></p><p>여기서 11800715035가 바로 <strong>상품 ID</strong>, 즉 productNo입니다.</p><p>별도 검사 없이 URL만 알면 충분합니다.</p><p>이제 channelUid와 productNo를 확보했으니, API 요청을 만들어보겠습니다.</p><h3>API 요청 보내기</h3><p>필요한 값은 이제 두 개입니다:</p><ul><li>channelUid: 2sWDw6fJMaeiT9eyhAmGd</li><li>productNo: 11800715035</li></ul><p>이 두 값만 있으면 네이버의 내부 API에 접근할 수 있습니다.<br> 추가로 withWindow=false를 붙이면 UI 관련 불필요한 데이터를 생략하고, 더 가볍고 깔끔한 JSON만 받아올 수 있습니다.</p><p>Scrape.do를 이용해 요청을 전송하는 예시는 다음과 같습니다:</p><pre>import requests<br>import urllib.parse<br><br># Scrape.do 토큰 입력<br>token = &quot;&lt;your_token&gt;&quot;<br><br># 상품 정보<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># 네이버 API URL 생성<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br><br># Scrape.do API 경로<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># 요청 전송<br>response = requests.get(api_url)<br><br># 응답 상태 출력<br>print(response)<br><br>정상적으로 작동하면 다음과 같은 결과를 확인할 수 있습니다:<br>&lt;Response [200]&gt;</pre><p>이제 네이버가 HTML이 아닌 <strong>깨끗한 JSON 데이터</strong>로 응답을 반환했고, 이를 기반으로 쉽게 파싱할 수 있습니다.</p><h3>정보 파싱 및 출력</h3><p>200 응답을 정상적으로 받았다면, 이제 주요 정보를 추출할 차례입니다.</p><p>우리가 추출할 항목은 아래 5가지입니다:</p><ul><li><strong>상품명</strong> → dispName</li><li><strong>할인가</strong> → discountedSalePrice</li><li><strong>할인율</strong> → benefitsView.discountedRatio</li><li><strong>대표 이미지 URL</strong> → representImage.url</li><li><strong>재고 수량</strong> → stockQuantity</li></ul><p>다음은 이를 파싱하고 출력하는 코드입니다:</p><pre>import requests<br>import urllib.parse<br><br># Scrape.do 토큰 입력<br>token = &quot;&lt;your_token&gt;&quot;<br><br># 상품 정보<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># 네이버 API URL 구성<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># 요청 및 JSON 파싱<br>response = requests.get(api_url)<br>data = response.json()<br><br># 항목 추출<br>name = data[&quot;dispName&quot;]<br>price = data[&quot;discountedSalePrice&quot;]<br>discount = data[&quot;benefitsView&quot;][&quot;discountedRatio&quot;]<br>image = data[&quot;representImage&quot;][&quot;url&quot;]<br>stock = data[&quot;stockQuantity&quot;]<br><br># 출력<br>print(&quot;Product Name:&quot;, name)<br>print(&quot;Price:&quot;, f&quot;{price:,}₩&quot;)<br>print(&quot;Discount:&quot;, f&quot;{discount}%&quot;)<br>print(&quot;Image URL:&quot;, image)<br>print(&quot;Stock Quantity:&quot;, stock)<br><br>실행 결과는 다음과 비슷할 것입니다:<br>Product Name: [QcK Heavy M 증정] 스틸시리즈 Arctis Nova 5 무선 게이밍 헤드셋 - 블랙 / 화이트<br>Price: 176,000₩<br>Discount: 11%<br>Image URL: https://shop-phinf.pstatic.net/20250507_71/1746586488548DMoJN_PNG/1170543923217933_1817156307.png<br>Stock Quantity: 968</pre><p>이제 정보가 올바르게 추출되었는지 확인했으니, .csv 파일로 저장해 봅시다.</p><h3>CSV로 내보내기</h3><p>아래는 .csv 파일로 추출 데이터를 저장하는 최종 코드입니다:</p><pre>import requests<br>import urllib.parse<br>import csv<br><br># Scrape.do 토큰 입력<br>token = &quot;&lt;your_token&gt;&quot;<br><br># 상품 정보<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># API URL 구성<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># 요청 및 파싱<br>response = requests.get(api_url)<br>data = response.json()<br><br># 항목 추출<br>name = data[&quot;dispName&quot;]<br>price = data[&quot;discountedSalePrice&quot;]<br>discount = data[&quot;benefitsView&quot;][&quot;discountedRatio&quot;]<br>image = data[&quot;representImage&quot;][&quot;url&quot;]<br>stock = data[&quot;stockQuantity&quot;]<br><br># CSV로 저장<br>with open(&quot;naver_product_data.csv&quot;, &quot;w&quot;, newline=&quot;&quot;, encoding=&quot;utf-8-sig&quot;) as f:<br>    writer = csv.writer(f)<br>    writer.writerow([&quot;Product Name&quot;, &quot;Price&quot;, &quot;Discount&quot;, &quot;Image URL&quot;, &quot;Stock Quantity&quot;])<br>    writer.writerow([name, price, f&quot;{discount}%&quot;, image, stock])<br><br>print(&quot;Data saved to naver_product_data.csv&quot;)<br><br>실행하면 아래 메시지가 출력됩니다:<br>Data saved to naver_product_data.csv</pre><p><strong>이제 네이버의 내부 API를 통해 깔끔하고 안정적인 상품 데이터를 확보했습니다.</strong></p><h3>차단당했나요? 아마 이런 이유일 겁니다</h3><p>요청이 실패했다면 — 특히 403, 429, 혹은 응답이 비어 있거나 이상할 경우 — 대부분은 아래 두 가지 이유 중 하나입니다:</p><h3>지역 제한(Geo-Restriction)에 걸렸습니다</h3><p>네이버의 상품 페이지 및 API는 <strong>지역 제한</strong>이 걸려 있습니다.<br> <strong>한국 외 지역 IP</strong>에서 접근하면 차단되거나 콘텐츠가 누락된 페이지가 표시될 수 있습니다.</p><p>해결 방법은 간단합니다: Scrape.do 요청 URL 끝에 &amp;geoCode=kr을 추가하세요.</p><p>최종 요청 URL 예시는 다음과 같습니다:</p><p>https://api.scrape.do?token=&lt;your_token&gt;&amp;url=&lt;encoded_url&gt;&amp;super=true&amp;geoCode=kr</p><p>이렇게 하면 <strong>한국 내 레지덴셜 IP</strong>를 통해 요청이 전달되어 안정적인 접속이 가능합니다.</p><h3>API 엔드포인트가 변경되었습니다</h3><p>네이버는 공식적으로 내부 API를 문서화하지 않습니다.<br> 그리고 이 API는 <strong>수시로 변경</strong>됩니다.</p><p>갑자기 요청이 실패하기 시작했다면, 아래 방법으로 엔드포인트를 다시 확인하세요:</p><ol><li>크롬에서 상품 페이지를 엽니다</li><li>F12 키를 눌러 개발자 도구를 엽니다</li><li><strong>Network</strong> 탭으로 이동합니다</li><li>페이지를 새로고침합니다</li><li>“Filter” 검색창에 상품 ID와 ?withWindow=false를 함께 입력합니다 (예: 11800715035?withWindow=false)</li><li>나타나는 요청 중 해당 항목을 클릭합니다</li><li>우측 패널에서 전체 <strong>Request URL</strong>을 복사합니다</li></ol><p>그 URL이 실제로 사용되는 내부 API 주소이며, 상황에 따라 달라질 수 있습니다.</p><p>항상 확실하게 확인하려면 이 방법으로 엔드포인트를 재구성하세요.</p><h3>결론</h3><p>네이버는<a href="https://scrape.do/blog/how-can-data-scraping-benefit-my-e-commerce-business/"> 이커머스 데이터 스크래핑</a>에서 가장 어려운 대상 중 하나입니다.<br> <strong>지역 제한</strong>, <strong>렌더링 트랩</strong>, 그리고 <strong>수시로 바뀌는 내부 구조</strong> 때문에,<br> 대부분의 스크래퍼는 200 OK 응답조차 받지 못하고 실패합니다.</p><p>하지만 channelUid 추출법을 알고, 내부 API를 사용할 수 있으며, 올바른 프록시 설정으로 요청을 전달할 수 있다면<br> <strong>스크래핑은 반복 가능하고 매우 안정적</strong>이 됩니다.</p><p>그리고 Scrape.do를 사용하면 다음과 같은 고민을 할 필요가 없습니다:</p><ul><li>프록시 회전, 브라우저 지문 위조</li><li>세션 유지 설정, TLS 설정</li><li>자바스크립트 렌더링, CAPTCHA 우회</li></ul><p>그저 요청만 보내면, <strong>깨끗하고 빠른 응답</strong>을 그대로 받아볼 수 있습니다.</p><p>👉 <a href="https://dashboard.scrape.do/signup?utm_source=medium&amp;utm_medium=naver_kr">지금 Scrape.do에 가입하고 1000 무료 크레딧으로 네이버 스크래핑을 시작하세요</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=deef701c04dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scraping Naver: Bypass Blocks and Extract Product Data]]></title>
            <link>https://mertbekci.medium.com/scraping-naver-bypass-blocks-and-extract-product-data-f8499f97ce11?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8499f97ce11</guid>
            <category><![CDATA[naver-data-extraction]]></category>
            <category><![CDATA[naver]]></category>
            <category><![CDATA[naver-data-scraping]]></category>
            <category><![CDATA[naver-scraping]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Tue, 20 May 2025 10:48:01 GMT</pubDate>
            <atom:updated>2025-05-20T10:48:01.034Z</atom:updated>
            <content:encoded><![CDATA[<p>Naver is South Korea’s most important search engine, ecommerce platform, and digital ecosystem; all rolled into one.</p><p>It dominates <strong>over 60% of Korea’s search market</strong>, powers countless Smart Stores (its e-commerce platform), and handles everything from news to payments.</p><p><em>If you’re scraping Korean web data, you’ll hit Naver sooner or later.</em></p><p>But scraping Naver isn’t easy.</p><h3>Why Is Scraping Naver Hard?</h3><p>Naver isn’t just a search engine; it’s <em>the backbone of Korean internet</em>.</p><p>This level of influence comes with tight control over access, especially to its e-commerce data.</p><p>Whether you’re trying to extract product details or search listings, you’ll quickly notice that <strong>Naver doesn’t want to be scraped.</strong></p><p>Here’s why most scrapers fail.</p><h3>Datacenter Proxies Are Blocked Instantly</h3><p>Naver actively blocks traffic from known datacenter IP ranges. Be ready to get familiar with this page really quickly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*W38qNDAx-FQtkRgpQ-XI9A.png" /></figure><p>If you’re sending requests from AWS, GCP, or any commercial proxy provider, you’re almost guaranteed to hit:</p><ul><li>403 Forbidden — request denied outright</li><li>429 Too Many Requests — rate-limited before you even start</li><li>502 Bad Gateway — fallback error, often shown when WAFs intervene</li></ul><p><strong>You won’t even get through the front door.</strong></p><p>To avoid this, <strong>you’ll need residential or mobile IPs</strong>, ideally from Korean ISPs, with session stickiness and rotating headers or you’ll get flagged immediately.</p><h3>JavaScript Rendering Isn’t Enough</h3><p>Even with a powerful headless browser, you might still end up with a blank page.</p><p>That’s because Naver uses <strong>multi-layered JavaScript challenges;</strong> sometimes tied to region, sometimes tied to session behavior.</p><p>And if your scraper doesn’t match expected patterns (browser fingerprint, TLS, execution timing), rendering will silently fail or loop endlessly.</p><p>Some pages return 200 OK and look like they load (like below), but never actually return real content unless every script executes correctly, in the right sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*wLKxlQLcQZk7kJhaZ66tUw.png" /></figure><p>That’s what makes Naver different: <em>it doesn’t just check if you’re a bot, </em><strong><em>it tests if you behave like a real user inside a Korean browser session.</em></strong></p><h3>How Scrape.do Bypasses These Challenges</h3><p>Scraping Naver with your own setup?</p><p>You’ll get blocked before the page even loads.</p><p>That’s because Naver checks <em>everything;</em> where you’re connecting from, how your browser behaves, and whether your session looks natural.</p><p><strong>Even well-configured headless browsers fail without the right IP and session setup.</strong></p><p><a href="https://scrape.do/">Scrape.do</a> <em>handles all of this under the hood, so you don’t have to.</em></p><ul><li><strong>KR residential IPs 🇰🇷</strong></li><li><strong>Sticky sessions 📌</strong></li><li><strong>Rotating headers &amp; TLS fingerprints 🔄</strong></li><li><strong>Full JavaScript rendering 🖼️</strong></li></ul><p>Without extensive setup and maintenance, you just send the URL and get the real page back, <strong>instantly.</strong></p><h3>Scrape Naver Product Details Directly From Product Page</h3><p>This is the most common approach: go directly to the product page, extract name, price, and other key details.</p><p>It works well <em>if</em> you can get past the initial blocks. For this tutorial, we’ll scrape the product page for <a href="https://brand.naver.com/steelseries/products/11800715035">a SteelSeries headset</a> <strong>using Python and Scrape.do.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*GGVOw92m44uPJdgFrjm1mA.png" /></figure><p>Before we send our first request, let’s make sure we have the tools we need.</p><h3>Prerequisites</h3><p>We’ll use Python and a few simple libraries:</p><ul><li>requests: To send our HTTP requests.</li><li>re: To locate desired elements from the returned HTML.</li><li><strong>Scrape.do API Token:</strong> You’ll need a Scrape.do token to access the page without getting blocked. You can <a href="https://dashboard.scrape.do/signup">sign up here for free</a> and get 1000 credits to start.</li></ul><p>Install requests if you don’t have it:</p><pre>pip install requests</pre><h3>Sending the First Request</h3><p>Let’s hit the product page and make sure we’re getting a real response.</p><p>We’ll use super=true to activate premium proxy routing — this is especially important for Naver, where regular IPs get blocked fast.</p><p>Here’s how to send the request:</p><pre>import requests<br>import urllib.parse# Your Scrape.do token<br>token = &quot;&lt;your_token&gt;&quot;<br># Naver product URL<br>target_url = &quot;https://brand.naver.com/steelseries/products/11800715035&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br># Scrape.do API endpoint with super=true for premium proxy routing<br>url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br># Send the request<br>response = requests.get(url)<br># Print status code<br>print(response)</pre><p><em>If the setup is working, you should see:</em></p><pre>&lt;Response [200]&gt;</pre><p>That means <strong>Naver let you in and we’re ready to start extracting data.</strong></p><h3>Extracting Product Name and Price</h3><p>Now that we’ve confirmed we’re getting a valid response, we can extract the product name and price directly from the page source.</p><p>❗ Usually we find on the page the information we’re trying to scrape and hit <strong><em>Inspect</em></strong> to get the element we need, but it won’t work this time. We need to go to the page source and find information we’re looking for there.</p><p>If you scroll through the HTML response, you’ll find that Naver injects all product information into a large embedded JSON block.</p><p>This is part of their internal state object, and it contains fields like &quot;dispName&quot; for the product title and &quot;dispDiscountedSalePrice&quot; for the final price shown on the page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGXd3eJitZ_7NO0zIsqAtw.png" /></figure><p>We don’t need to parse the entire JSON. A simple regular expression will do the job.</p><p>Here’s how:</p><pre>import requests<br>import urllib.parse<br>import re<br><br># Your Scrape.do token<br>token = &quot;&lt;your_token&gt;&quot;<br><br># Target URL<br>target_url = urllib.parse.quote_plus(&quot;https://brand.naver.com/steelseries/products/11800715035&quot;)<br><br># Scrape.do API endpoint with premium proxy routing<br>url = f&quot;https://api.scrape.do?token={token}&amp;url={target_url}&amp;super=true&quot;<br><br># Send the request<br>response = requests.get(url)<br><br># Extract the values via regex<br>html = response.text<br>product_name = re.search(r&#39;&quot;dispName&quot;:&quot;([^&quot;]+)&quot;&#39;, html).group(1)<br>discounted_price = int(re.search(r&#39;&quot;dispDiscountedSalePrice&quot;:([0-9]+)&#39;, html).group(1))<br><br># Print product name and price<br>print(&quot;Product Name:&quot;, product_name)<br>print(&quot;Price:&quot;, f&quot;{discounted_price:,}₩&quot;)</pre><p>You output should look like this:</p><pre>Product Name: [QcK Heavy M 증정] 스틸시리즈 Arctis Nova 5 무선 게이밍 헤드셋 - 블랙 / 화이트<br>Price: 176,000₩</pre><p>And voila! You’ve scraped a product from Naver.</p><p>However, my experience using this method has been inconsistent.</p><p><strong>The security at Naver is TIGHT!</strong></p><p>So, I’ve found a slightly different approach that uses their API endpoint:</p><h3>Scrape Naver API Endpoint for Product Details</h3><p>If you want something faster, more stable, and easier to parse, Naver’s own API is the better option. It returns clean JSON, loads faster, and is more consistent across products.</p><p><em>The only catch?</em></p><p><strong>You need to build the API request yourself.</strong></p><p>But the good news is: it’s easier than it sounds.</p><p>You only need two things:</p><ul><li>channelUid: the store identifier (like a brand or seller)</li><li>productNo: the product ID (already in the URL)</li></ul><p>And chances are, if you’re scraping Naver, you’re targeting specific stores anyway, which means you can reuse the channelUid across dozens or hundreds of products.</p><p>Let me show you how to find it:</p><h3>Find channelUid</h3><p>The easiest way to find channelUid is by inspecting the page source.</p><p>Right-click anywhere on the product page and hit <strong>Inspect</strong>, or press F12.</p><p>Once DevTools opens, press Ctrl + F and search for:</p><pre>channelUid</pre><p>You’ll see it in plain text, should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*MHz8z5MLNYzeyaL-wFiBjg.png" /></figure><p>That’s the value you need.</p><p>This ID is unique to the store (in this case, SteelSeries), and it’ll stay the same across all their product pages so once you grab it, you can reuse it for as many products as you want from that seller.</p><h3>Find Product ID</h3><p><strong>This one’s even easier.</strong></p><p>Just look at the URL:</p><pre>https://brand.naver.com/steelseries/products/11800715035</pre><p>11800715035 is the <strong>product ID</strong>, also referred to as productNo in Naver’s API.</p><p>No need to inspect anything. If you have the product URL, you already have the ID.</p><p>Now that we’ve got both the channelUid and productNo, let’s build the API request.</p><h3>Sending the Request</h3><p>We now have both pieces we need:</p><ul><li>channelUid: 2sWE13PU92zxrIFi44IbY</li><li>productNo: 11800715035</li></ul><p>These two values are all you need to hit Naver’s internal API. We’ll also append withWindow=false to skip extra UI data and get a lighter, cleaner JSON response.</p><p>Here’s how to build and send the request using Scrape.do:</p><pre>import requests<br>import urllib.parse<br><br># Your Scrape.do token<br>token = &quot;&lt;your_token&gt;&quot;<br><br># Product identifiers<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># Naver API target<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br><br># Scrape.do API endpoint<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># Send the request<br>response = requests.get(api_url)<br><br># Print response status<br>print(response)</pre><p>If everything works, you’ll see:</p><pre>&lt;Response [200]&gt;</pre><p>That means Naver responded with the full product data; no HTML, no noise, <strong>just clean JSON we can work with next.</strong></p><h3>Parse and Export</h3><p>Once we get a successful 200 response from Naver’s API, you’ll see that the rest is easy.</p><p>Here are the 5 key fields we’ll extract:</p><ul><li><strong>Product Name</strong> → dispName</li><li><strong>Discounted Price</strong> → discountedSalePrice</li><li><strong>Discount Ratio</strong> → benefitsView.discountedRatio</li><li><strong>Image URL</strong> → representImage.url</li><li><strong>Stock Quantity</strong> → stockQuantity</li></ul><p>Let’s print them first:</p><pre>import requests<br>import urllib.parse<br><br># Your Scrape.do token<br>token = &quot;&lt;your_token&gt;&quot;<br><br># Product identifiers<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># Build the Naver API URL<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># Send the request<br>response = requests.get(api_url)<br>data = response.json()<br><br># Extract fields<br>name = data[&quot;dispName&quot;]<br>price = data[&quot;discountedSalePrice&quot;]<br>discount = data[&quot;benefitsView&quot;][&quot;discountedRatio&quot;]<br>image = data[&quot;representImage&quot;][&quot;url&quot;]<br>stock = data[&quot;stockQuantity&quot;]<br><br># Print the results<br>print(&quot;Product Name:&quot;, name)<br>print(&quot;Price:&quot;, f&quot;{price:,}₩&quot;)<br>print(&quot;Discount:&quot;, f&quot;{discount}%&quot;)<br>print(&quot;Image URL:&quot;, image)<br>print(&quot;Stock Quantity:&quot;, stock)</pre><p>Here’s what will print out:</p><pre>Product Name: [QcK Heavy M 증정] 스틸시리즈 Arctis Nova 5 무선 게이밍 헤드셋 - 블랙 / 화이트<br>Price: 176,000₩<br>Discount: 11%<br>Image URL: https://shop-phinf.pstatic.net/20250507_71/1746586488548DMoJN_PNG/1170543923217933_1817156307.png<br>Stock Quantity: 968</pre><p>Now that we’ve confirmed the values are correct, let’s export them to a .csv file so we can reuse the data later or analyze it at scale.</p><p>Here’s the final version with export:</p><pre>import requests<br>import urllib.parse<br>import csv<br><br># Your Scrape.do token<br>token = &quot;&lt;your_token&gt;&quot;<br><br># Product identifiers<br>channel_uid = &quot;2sWDw6fJMaeiT9eyhAmGd&quot;<br>product_id = &quot;11800715035&quot;<br><br># Build request<br>target_url = f&quot;https://brand.naver.com/n/v2/channels/{channel_uid}/products/{product_id}?withWindow=false&quot;<br>encoded_url = urllib.parse.quote_plus(target_url)<br>api_url = f&quot;https://api.scrape.do?token={token}&amp;url={encoded_url}&amp;super=true&quot;<br><br># Request and parse<br>response = requests.get(api_url)<br>data = response.json()<br><br># Extract details<br>name = data[&quot;dispName&quot;]<br>price = data[&quot;discountedSalePrice&quot;]<br>discount = data[&quot;benefitsView&quot;][&quot;discountedRatio&quot;]<br>image = data[&quot;representImage&quot;][&quot;url&quot;]<br>stock = data[&quot;stockQuantity&quot;]<br><br># Export to CSV<br>with open(&quot;naver_product_data.csv&quot;, &quot;w&quot;, newline=&quot;&quot;, encoding=&quot;utf-8-sig&quot;) as f:<br>    writer = csv.writer(f)<br>    writer.writerow([&quot;Product Name&quot;, &quot;Price&quot;, &quot;Discount&quot;, &quot;Image URL&quot;, &quot;Stock Quantity&quot;])<br>    writer.writerow([name, price, f&quot;{discount}%&quot;, image, stock])<br><br>print(&quot;Data saved to naver_product_data.csv&quot;)</pre><p>You should see:</p><pre>Data saved to naver_product_data.csv</pre><p><strong>And that’s clean, reliable product data straight from Naver’s internal API.</strong></p><h3>Blocked? Here’s (Probably) Why</h3><p>If your request fails — especially with a 403, 429, or a blank page — it usually comes down to one of two things:</p><h3>You’re Geo-Restricted</h3><p>Naver’s product pages and APIs are region-locked. If your IP isn’t coming from South Korea, you’ll likely be blocked or shown incomplete content.</p><p>To fix this, just add &amp;geoCode=kr to the end of your Scrape.do request URL.</p><p>So your final request should look like this:</p><pre>https://api.scrape.do?token=&lt;your_token&gt;&amp;url=&lt;encoded_url&gt;&amp;super=true&amp;geoCode=kr</pre><p>This tells Scrape.do to route your request through a <strong>Korean residential IP</strong>, which is required for consistent access to Naver.</p><h3>The API Endpoint Has Been Changed</h3><p>Naver doesn’t officially document their internal API and they <em>do</em> change it from time to time.</p><p>If your API request suddenly stops working, you’ll need to reconfirm the endpoint:</p><ol><li>Open the product page in Chrome</li><li>Press F12 to open DevTools</li><li>Go to the <strong>Network</strong> tab</li><li>Refresh the page</li><li>In the “Filter” input, type the <strong>product ID plus </strong><strong>?withWindow=false</strong><br>(e.g. 11800715035?withWindow=false)</li><li>Click the matching request that appears</li><li>The full <strong>Request URL</strong> will be the internal API endpoint</li></ol><p>That’s the real URL you need to use and it may change depending on Naver’s current architecture.</p><p>If you’re ever unsure, fall back to this method and rebuild your API request accordingly.</p><h3>Conclusion</h3><p>Naver is a tough target for <a href="https://scrape.do/blog/how-can-data-scraping-benefit-my-e-commerce-business/">e-commerce scraping</a>; between geo-blocking, headless rendering traps, and a constantly shifting internal structure, <strong>most</strong> <strong>scrapers fail before they even get a 200 response.</strong></p><p>But once you know how to extract channelUid, use the internal API, and route your requests through the right proxies, it becomes simple and repeatable.</p><p><strong>And with Scrape.do, you don’t need to worry about:</strong></p><ul><li>Proxy rotation or fingerprinting</li><li>Session headers or TLS configs</li><li>JavaScript rendering or CAPTCHA solving</li></ul><p>Just send the request and get <strong>clean, fast, and unblocked access to important data.</strong></p><p><a href="https://dashboard.scrape.do/signup?utm_source=medium&amp;utm_medium=naver_en">Get 1000 free credits and start scraping Naver now.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8499f97ce11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a custom domain for Bento.me [TR]]]></title>
            <link>https://mertbekci.medium.com/using-a-custom-domain-for-bento-me-tr-0ede8ed6612f?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ede8ed6612f</guid>
            <category><![CDATA[wrangler]]></category>
            <category><![CDATA[bento]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[scraping]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 05:35:25 GMT</pubDate>
            <atom:updated>2024-12-31T05:35:25.894Z</atom:updated>
            <content:encoded><![CDATA[<p>Cloudflare Workers ile bento.me/mertbekci sayfasını bento.mertbekci.com domaini üzerinden görüntüleyeceğiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L-bxQNm_kc3TNGG7" /><figcaption>Photo by <a href="https://unsplash.com/@barkiple?utm_source=medium&amp;utm_medium=referral">John Barkiple</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Cloudflare Workers için detaylı bilgiye <a href="https://workers.cloudflare.com/">buradan</a> ulaşabilirsiniz, <a href="https://openai.com/blog/chatgpt/">ChatGPT</a>’ye nedir diye sordum ve uzun uzun açıkladı👇</p><p><em>Cloudflare Workers, Cloudflare tarafından sunulan bir hizmettir ve JavaScript işlevlerinin yürütülmesi için özel olarak tasarlanmış bir platformdur. Cloudflare Workers, bir uygulamanın istemci tarafında yürütülebilecek tüm JavaScript kodunun yazılmasına olanak tanır ve böylece işlevleri özelleştirir ve daha hızlı bir yanıt süresi sağlar.</em></p><p><em>Cloudflare Workers, bir dizi kullanım senaryosu için uygundur. Örneğin, işlevler, önbelleğe alma, yönlendirme, yeniden yönlendirme ve loglama gibi web trafiği yönetimi işlemlerinde kullanılabilir. Cloudflare Workers ayrıca, genellikle büyük miktarda işlemci kaynağı gerektiren ve yüksek trafikli web sitelerinde kullanılabilecek ölçeklenebilir işlevleri de destekler.</em></p><p>Öncelikle <a href="https://developers.cloudflare.com/workers/">wrangler</a> (workers cli) yükleyelim ve projemizi oluşturalım</p><pre>yarn global add wrangler</pre><pre>wrangler login</pre><pre>wrangler init worker-mertbekci</pre><pre>cd worker-mertbekci</pre><pre>wrangler dev</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CxKv9mrBD2z1bD9iw0pJg.png" /><figcaption>Burada ben kuruluma “Fetch Handler” seçeneği ile devam ettim</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXe5FWNUt4MJNZI216zGbQ.png" /><figcaption>Her şey yolunda gözüküyor 🙃</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rx_YhPCb9c1f0e-z_5KBkA.png" /><figcaption>Projede son durum bu şekilde</figcaption></figure><p>wrangler.toml dosyasını açarak hemen route ve env düzenlememi yapıyorum.</p><pre>name = &quot;worker-mertbekci&quot;<br>main = &quot;src/index.ts&quot;<br>compatibility_date = &quot;2023-02-26&quot;<br>workers_dev = true</pre><pre>[vars]<br>BASE_URL = &quot;http://127.0.0.1:8787&quot;</pre><pre># Override values for `--env production` usage<br>[env.production]<br>routes = [<br> { pattern = &quot;mertbekci.com&quot;, custom_domain = true }<br>]<br>[env.production.vars]<br>BASE_URL = &quot;https://mertbekci.com&quot;</pre><p>index.ts dosyasına geldim ve <a href="https://developers.cloudflare.com/workers/examples/fetch-html/">Fetch HTML</a> örneğini kullanarak ilerleyeceğim.</p><p>Temelde yaptığımız iş kendi domainimize gelen requestler farklı bir domaine yönlendirerek gelen responseları kendi domainimize dönmek 😅</p><p><a href="https://bento.me/en/home">Bento.me</a> sitesini incelediğimde kaynakları bento.me domaini üzerinden yüklerken bazı dataları api üzerinden alıyordu, api tarafına çıkan istekleri CORS hatasına düştüğü için responseları kendi return etmeden önce replace işlemi çalıştırdım ve ilk request geldiğinde pathleri api path i olan requestleri “<em>https://api.bento.me</em>” domainine yönlendirirken diğer gelen pathlerde “<em>https://bende.me</em>” domainine yönlendirdim. Böylelikle tüm requestler “<em>mertbekci.com </em>” adresine gidiyordu ama arkaplanda hepsi “<em>bento.me</em>” olarak çalışıyordu. 😇</p><pre>export default {<br>  async fetch(request: Request, env: Env): Promise&lt;Response&gt; {<br>    const requestUrl = new URL(request.url);<br>    let someHost = &quot;https://bento.me&quot;;<br>    const path = requestUrl.pathname;</pre><pre>    if (path.includes(&quot;v1&quot;)) {<br>      someHost = &quot;https://api.bento.me&quot;;<br>    }</pre><pre>    let url = someHost + requestUrl.pathname;<br>    if (url === &quot;https://bento.me/&quot;) {<br>      url = &quot;https://bento.me/mertbekci&quot;;<br>    }</pre><pre>    const init = {<br>      headers: {<br>        &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;,<br>        &quot;Access-Control-Allow-Methods&quot;: &quot;GET,HEAD,POST,OPTIONS&quot;,<br>        &quot;content-type&quot;: &quot;text/plain;charset=UTF-8&quot;,<br>      },<br>    };<br>    async function gatherResponse(response: Response, contentType: string) {<br>      if (contentType.includes(&quot;application/json&quot;)) {<br>        return JSON.stringify(await response.json());<br>      } else if (contentType.includes(&quot;application/text&quot;)) {<br>        return response.text();<br>      } else if (contentType.includes(&quot;text/html&quot;)) {<br>        return response.text();<br>      } else {<br>        return response.text();<br>      }<br>    }</pre><pre>    const response = await fetch(url, init);<br>    const contentType = response.headers.get(&quot;content-type&quot;)!;<br>    let results = await gatherResponse(response, contentType);<br>    results = results.replaceAll(&quot;https://api.bento.me&quot;, env.BASE_URL);</pre><pre>    init.headers[&quot;content-type&quot;] = contentType;<br>    return new Response(results, init);<br>  },<br>};</pre><p>Localde çalışmak için “<em>wrangler dev</em>” komutunu çalıştırabilirsiniz.<br>Son olarak artık “ <em>wrangler publish — env production</em>” komutu ile publish alıyoruz, artık <a href="https://bento.mertbekci.com/">bento.mertbekci.com</a> adresinde kontrol ediyorum ve mutlu son 🫶🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKemWrqW7_weEYpI4i1jBQ.png" /><figcaption>mertbekci.com</figcaption></figure><p>Projenin tamamına buradan ulaşabilirsiniz<br>👉🏻 <a href="https://github.com/mertbekci">github.com/mertbekci</a></p><p>Yeni yazılarda görüşmek üzere, diğer yazılarım için buraya göz atabilirsiniz 👉🏻 <a href="https://mertbekci.com/">mertbekci.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ede8ed6612f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generate your Currency API with Cloudflare Workers.]]></title>
            <link>https://mertbekci.medium.com/generate-your-currency-api-with-cloudflare-workers-d13318b03cdb?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/d13318b03cdb</guid>
            <category><![CDATA[cloudflare-workers]]></category>
            <category><![CDATA[currency]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[cloudflare]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 20:19:14 GMT</pubDate>
            <atom:updated>2024-02-19T08:06:41.859Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uE7ODhX9wwQyaIDF" /><figcaption>Photo by <a href="https://unsplash.com/@goshua13?utm_source=medium&amp;utm_medium=referral">Joshua Aragon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Cloudflare Workers başka neler yapılabileceğini merak ediyor musunuz? Zamanlanmış görevler, cachelenmiş datalar ve daha fazlası …</p><p>CF Workers ile bu ara fazla zaman geçiriyorum, özelliklerini sizlerle paylaşabilmek için ülkemizin gündeminden hiç düşmediği için kurlar özelinde bir örnek kurguladım.</p><blockquote>CF Workers ile bir api geliştireceğiz ve CF KV ile cacheleme yapacağız, CF Trigger ile zamanlanmış görev oluşturacağız ve minimum gecikme ile en güncel kur verilerine ulaşmaya çalışacağız. Hadi başlayalım..</blockquote><p>Önce projemizi oluşturalım — wrangler kurulumu ile ilgili daha önce <a href="https://mertbekci.com/using-custom-domain-for-bento-me-ac24c6ae21ff">bu yazımda</a> detaylı bilgi paylaşmıştım — hemen arkasından da CF KV için id’lerimizi oluşturalım ve gerekli olacak paketlerimizi ekleyelim</p><pre>wrangler init currency-api<br><br>//prod<br>wrangler kv:namespace create CURRENCY_KV<br>//local<br>wrangler kv:namespace create CURRENCY_KV --preview<br><br>//packages <br>yarn add dayjs<br>yarn add node-html-parser<br></pre><p>Oluşan keyleri wrangler dosyası içerisinde aşağıdaki formatta güncelleyelim.</p><pre>name = &quot;currency-api&quot;<br>main = &quot;src/worker.ts&quot;<br>compatibility_date = &quot;2023-09-04&quot;<br><br><br>routes = [<br> { pattern = &quot;currency.mertbekci.com&quot;, custom_domain = true }<br>]<br>kv_namespaces = [<br> { binding = &quot;CURRENCY_KV&quot;, id = &quot;{prod_id}&quot;, preview_id = &quot;{preview_id}&quot; }<br>]</pre><p>Oluşan proje de Hello world kısmını hemen aşağıdaki şekilde güncelleyerek öncelikle json dönmesini sağlayalım ve <em>wrangler dev </em>komutunu terminalden çalıştırıp çıktısını görelim.</p><pre>export default {<br> async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise&lt;Response&gt; {<br>  return new Response(<br>   JSON.stringify({<br>    message: &#39;Hello World!&#39;,<br>   }),<br>   {<br>    headers: {<br>     &#39;content-type&#39;: &#39;application/json&#39;,<br>    },<br>   }<br>  );<br> },<br>};</pre><p>Basit olarak bir API var artık elimizde ve çıktısı bu şekilde.</p><figure><img alt="Hello World" src="https://cdn-images-1.medium.com/max/1024/1*NTaSw8UBoQ1BeG_hTrhjng.png" /></figure><p>Şimdi Google Finans üzerinden dolar kurunu almaya çalışalım, bunu basit bir şekilde fetch ile istek göndererek yapacağız ve gelen html datayı parse edeceğiz. node-html-parser paketini burada kullanacağız.</p><pre>import { parse } from &#39;node-html-parser&#39;;<br><br>export default {<br> async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise&lt;Response&gt; {<br>  const response = await fetch(&#39;https://www.google.com/finance/quote/USD-TRY&#39;, {<br>   method: &#39;GET&#39;,<br>   headers: {<br>    &#39;Content-Type&#39;: &#39;application/html&#39;,<br>   },<br>  });<br>  const doc = parse(await response.text());<br>  const rate = parseFloat(doc.querySelector(&#39;.YMlKec.fxKbKc&#39;)?.text.replaceAll(&#39;₺&#39;, &#39;&#39;) || &#39;0&#39;);<br><br>  return new Response(<br>   JSON.stringify({<br>    rate,<br>   }),<br>   {<br>    headers: {<br>     &#39;content-type&#39;: &#39;application/json&#39;,<br>    },<br>   }<br>  );<br> },<br>};</pre><p>Artık sadece dolar kurunu dönen bir API’ımız var 🤑, işleri biraz daha geliştirelim ve burada dikkat etmemiz gereken şeylerden biri de response süreleri. Sadece tek oran almama rağmen <strong>2.55s</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V64ZmH_DHbKihCCrLTiCxA.png" /></figure><p>Google Finans url’ini belli bir formatta oluşturduğunuz taktirde bütün güncel oranlar alınabilmektedir. Parse edilen datanın ortak olduğunu farkettiğim için toplamak istediğim oranlar için bir array oluşturarak döngü ile oranları aldım.</p><pre><br>import { parse } from &#39;node-html-parser&#39;;<br><br>type ResponseObject = {<br> rates: object;<br>};<br><br>export default {<br> async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise&lt;Response&gt; {<br>  async function getCurrency(currencyCode: string): Promise&lt;number&gt; {<br>   const response = await fetch(`https://www.google.com/finance/quote/${currencyCode}`, {<br>    method: &#39;GET&#39;,<br>    headers: {<br>     &#39;Content-Type&#39;: &#39;application/html&#39;,<br>    },<br>   });<br>   const doc = parse(await response.text());<br>   return parseFloat(doc.querySelector(&#39;.YMlKec.fxKbKc&#39;)?.text.replaceAll(&#39;₺&#39;, &#39;&#39;) || &#39;0&#39;);<br>  }<br>  const rates = [&#39;USD-TRY&#39;, &#39;EUR-TRY&#39;, &#39;GBP-TRY&#39;];<br>  const result: ResponseObject = {<br>   rates: {},<br>  };<br>  for (let i = 0; i &lt; rates.length; i++) {<br>   const rate = rates[i];<br>   const value = await getCurrency(rate);<br>   result.rates = {<br>    ...result.rates,<br>    [rate]: value.toFixed(4),<br>   };<br>  }<br><br>  return new Response(JSON.stringify(result), {<br>   headers: {<br>    &#39;content-type&#39;: &#39;application/json&#39;,<br>   },<br>  });<br> },<br>};</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ew6K5obdniB3NJ8aaKNPQQ.png" /></figure><blockquote>Workers KV temelde key-value data saklayabildiğimiz bir servis ve çok düşük gecikme süreleri ile yanıt vermektedir. Detaylı bilgi için <a href="https://developers.cloudflare.com/workers/runtime-apis/kv/">buraya</a> bakabilirsiniz.</blockquote><p>Öncelikle response için bir model oluşturdum ve data alındığı tarih ve saati sakladım. Klasik bir mantık, data cache de yoksa cache’e at, varsa cache’den dön. Bu işlem yapıldı, ve cache’i ben 7 günlük tutmak istedim, bazı kontroller ekledim ve son olarak scheduled eventi kullanılarak zamanlanmış görev oluşturdum.</p><p><em>Örnek kod ve çıktısı aşağıdaki gibidir.</em></p><pre><br>import &#39;dayjs/plugin/timezone&#39;;<br>import { parse } from &#39;node-html-parser&#39;;<br>import dayjs, { Dayjs } from &#39;dayjs&#39;;<br>import utc from &#39;dayjs/plugin/utc&#39;;<br>import timezone from &#39;dayjs/plugin/timezone&#39;;<br><br>dayjs.extend(utc);<br>dayjs.extend(timezone);<br><br>export interface Env {<br> CURRENCY_KV: KVNamespace;<br>}<br><br>type ResponseObject = {<br> date: string;<br> time: string;<br> rates: object;<br>};<br><br>export default {<br> async scheduled(event: Event, env: Env, ctx: ExecutionContext) {<br>  const today = dayjs();<br>  ctx.waitUntil(getCurrencies(env, today));<br> },<br> async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise&lt;Response&gt; {<br>  const url = new URL(request.url);<br>  let path = url.pathname.slice(1).split(&#39;/&#39;).shift();<br><br>  if (path === &#39;favicon.ico&#39;) {<br>   return new Response(null, {<br>    status: 404,<br>   });<br>  }<br><br>  let dateProp = url.searchParams.get(&#39;date&#39;);<br>  let date = dayjs(dateProp, &#39;YYYY-MM-DD&#39;).isValid() ? dayjs(dateProp) : null;<br>  const today = dayjs();<br><br>  if (dayjs(date, &#39;YYYY-MM-DD&#39;).isValid()) {<br>   date = dayjs(date);<br>  } else if (date === null) {<br>   date = today;<br>  } else {<br>   return new Response(JSON.stringify({ error: &#39;Invalid date format. Please use YYYY-MM-DD format.&#39;, date }), {<br>    status: 400,<br>    headers: { &#39;content-type&#39;: &#39;application/json;charset=UTF-8&#39; },<br>   });<br>  }<br><br>  const cachedValue = await env.CURRENCY_KV.get(date.format(&#39;YYYY-MM-DD&#39;));<br><br>  if (cachedValue) {<br>   return new Response(cachedValue, {<br>    headers: {<br>     &#39;content-type&#39;: &#39;application/json;charset=UTF-8&#39;,<br>    },<br>   });<br>  }<br><br>  if (date !== today) {<br>   return new Response(JSON.stringify({ error: &#39;Currency information not found for your date&#39;, date }), {<br>    status: 404,<br>    headers: { &#39;content-type&#39;: &#39;application/json;charset=UTF-8&#39; },<br>   });<br>  }<br><br>  const responseObject = await getCurrencies(env, date);<br>  const result = JSON.stringify(responseObject);<br><br>  return new Response(result, {<br>   headers: {<br>    &#39;content-type&#39;: &#39;application/json;charset=UTF-8&#39;,<br>   },<br>  });<br> },<br>};<br><br>async function getCurrencies(env: Env, date: Dayjs): Promise&lt;ResponseObject&gt; {<br> async function getCurrency(currencyCode: string): Promise&lt;number&gt; {<br>  const response = await fetch(`https://www.google.com/finance/quote/${currencyCode}`, {<br>   method: &#39;GET&#39;,<br>   headers: {<br>    &#39;Content-Type&#39;: &#39;application/html&#39;,<br>   },<br>  });<br>  const doc = parse(await response.text());<br>  return parseFloat(doc.querySelector(&#39;.YMlKec.fxKbKc&#39;)?.text.replaceAll(&#39;₺&#39;, &#39;&#39;) || &#39;0&#39;);<br> }<br><br> const rates = [&#39;USD-EUR&#39;, &#39;USD-TRY&#39;, &#39;EUR-TRY&#39;, &#39;GBP-TRY&#39;];<br><br> date = dayjs.tz(date, &#39;Europe/Istanbul&#39;);<br> const result: ResponseObject = {<br>  date: date.format(&#39;YYYY-MM-DD&#39;),<br>  time: date.format(&#39;HH:mm:ss&#39;),<br>  rates: {},<br> };<br> for (let i = 0; i &lt; rates.length; i++) {<br>  const rate = rates[i];<br>  const value = await getCurrency(rate);<br>  result.rates = {<br>   ...result.rates,<br>   [rate]: value.toFixed(4),<br>  };<br> }<br><br> await env.CURRENCY_KV.put(date.format(&#39;YYYY-MM-DD&#39;), JSON.stringify(result), {<br>  expirationTtl: 60 * 60 * 24 * 7,<br> });<br> return result;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNSpp9gH3oibCkWGFj91Fw.png" /></figure><p>Sheduled eventini kullandık ama ne zamanlar tetikleneceğine dair bir şey belirtmedik, tetiklenme işlemlerini yönetebilmek için wrangler.toml dosyasına aşağıdaki örnekteki gibi triggers ekliyoruz. Ben buradaki örnekte Gün içerisinde (9–19 arası) 5 dakikada bir hafta sonları saatte bir çalışacak şekilde oluşturmaya çalıştım 🙂</p><pre>[triggers]<br>crons = [&quot;*/5 6-16 * * 2-6&quot;, &quot;0 6-16 * * 1,7&quot;]</pre><p><strong>Sonuç</strong></p><p>İstediğim kur bilgilerini kendi servisim aracılığı ile düzenli olarak cache i güncellemesini sağladım, ve normalde datayı scrape ederek getirmesi <strong>2.55s </strong>sürerken artık kendisi zamanlanmış olarak cachelediği için <strong>5ms’de </strong>yanıt dönmektedir 😎<br>Tabi ki burada bir örnek üzerinden CloudFlare Workers kullanarak bir API ile cache ve zamanlanmış görevler kullanımını anlatmaya çalıştım, gerçek hayatta size yardımcı olması dileği ile selamlar 👋</p><p>Yeni yazılarda görüşmek üzere, diğer yazılarıma buradan göz atabilirsiniz. 👉🏻 <a href="https://mertbekci.com/">mertbekci.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d13318b03cdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using custom domain for Bento.me]]></title>
            <link>https://mertbekci.medium.com/using-custom-domain-for-bento-me-ac24c6ae21ff?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac24c6ae21ff</guid>
            <category><![CDATA[domains]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[bento]]></category>
            <category><![CDATA[workers]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 14:18:32 GMT</pubDate>
            <atom:updated>2025-05-20T10:49:38.309Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using a custom domain for Bento.me [EN]</h3><p>We’ll display the <a href="https://bento.me/mertbekci">bento.me/mertbekci</a> page through the bento.mertbekci.com domain using Cloudflare Workers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L-bxQNm_kc3TNGG7" /><figcaption>Photo by <a href="https://unsplash.com/@barkiple?utm_source=medium&amp;utm_medium=referral">John Barkiple</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For detailed information on Cloudflare Workers, you can visit <a href="https://developers.cloudflare.com/workers/">Cloudflare Workers Documentation</a>. I also asked ChatGPT about it, and here’s a comprehensive explanation👇</p><p><em>Cloudflare Workers is a service provided by Cloudflare that is designed specifically for executing JavaScript functions. It allows the writing of all JavaScript code that can be executed on the client side of an application, thereby customizing functions and providing faster response times.</em></p><p><em>Cloudflare Workers is suitable for a range of use cases. For instance, functions can be used in web traffic management tasks such as caching, routing, redirecting, and logging. It also supports scalable tasks that typically require substantial processing resources and can be used on high-traffic websites.</em></p><p><strong>First, let’s install </strong><a href="https://developers.cloudflare.com/workers/"><strong>Wrangler</strong></a><strong> (the Workers CLI) and set up our project:</strong></p><pre>yarn global add wrangler<br><br>wrangler login<br><br>wrangler init worker-mertbekci<br><br>cd worker-mertbekci<br><br>wrangler dev<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CxKv9mrBD2z1bD9iw0pJg.png" /><figcaption>Here, I proceeded with the “Fetch Handler” option during setup.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXe5FWNUt4MJNZI216zGbQ.png" /><figcaption>Everything seems fine 🙃</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rx_YhPCb9c1f0e-z_5KBkA.png" /><figcaption>This is the latest status of the project</figcaption></figure><p>Let’s open the wrangler.toml file and adjust the route and environment variables:</p><pre>name = &quot;worker-mertbekci&quot;<br>main = &quot;src/index.ts&quot;<br>compatibility_date = &quot;2023-02-26&quot;<br>workers_dev = true<br><br>[vars]<br>BASE_URL = &quot;http://127.0.0.1:8787&quot;<br><br># Override values for `--env production` usage<br>[env.production]<br>routes = [<br> { pattern = &quot;mertbekci.com&quot;, custom_domain = true }<br>]<br>[env.production.vars]<br>BASE_URL = &quot;https://mertbekci.com&quot;</pre><p>Moving on to the index.ts file, I’ll proceed using the <a href="https://developers.cloudflare.com/workers/examples/fetch-html/">Fetch HTML</a> example.</p><p>Essentially, what we’re doing is redirecting requests coming to our own domain to a different domain and returning the responses to our domain 😅</p><p>Upon examining the Bento.me site, I noticed that while it loads resources from the bento.me domain, it fetches some data through its API. Requests to the API resulted in CORS errors, so before returning the responses, I implemented a replace operation. When a request first arrives, if the path pertains to the API, I redirect it to the <a href="https://api.bento.me/">https://api.bento.me</a> domain; for other paths, I redirect to the <a href="https://bento.me/">https://bento.me</a> domain. This way, all requests appear to go to mertbekci.com, but in the background, they function as if they’re interacting with bento.me. 😇</p><pre>export default {<br>  async fetch(request: Request, env: Env): Promise&lt;Response&gt; {<br>    const requestUrl = new URL(request.url);<br>    let someHost = &quot;https://bento.me&quot;;<br>    const path = requestUrl.pathname;<br><br>    if (path.includes(&quot;v1&quot;)) {<br>      someHost = &quot;https://api.bento.me&quot;;<br>    }<br><br>    let url = someHost + requestUrl.pathname;<br>    if (url === &quot;https://bento.me/&quot;) {<br>      url = &quot;https://bento.me/mertbekci&quot;;<br>    }<br><br>    const init = {<br>      headers: {<br>        &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;,<br>        &quot;Access-Control-Allow-Methods&quot;: &quot;GET,HEAD,POST,OPTIONS&quot;,<br>        &quot;content-type&quot;: &quot;text/plain;charset=UTF-8&quot;,<br>      },<br>    };<br>    async function gatherResponse(response: Response, contentType: string) {<br>      if (contentType.includes(&quot;application/json&quot;)) {<br>        return JSON.stringify(await response.json());<br>      } else if (contentType.includes(&quot;application/text&quot;)) {<br>        return response.text();<br>      } else if (contentType.includes(&quot;text/html&quot;)) {<br>        return response.text();<br>      } else {<br>        return response.text();<br>      }<br>    }<br><br>    const response = await fetch(url, init);<br>    const contentType = response.headers.get(&quot;content-type&quot;)!;<br>    let results = await gatherResponse(response, contentType);<br>    results = results.replaceAll(&quot;https://api.bento.me&quot;, env.BASE_URL);<br><br>    init.headers[&quot;content-type&quot;] = contentType;<br>    return new Response(results, init);<br>  },<br>};</pre><p>To run it locally, you can execute the “wrangler dev” command.<br>Finally, we can publish it using the “wrangler publish — env production” command. Now, I check the bento.mertbekci.com address, and it’s a happy ending 🫶🏼</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKemWrqW7_weEYpI4i1jBQ.png" /><figcaption>mertbekci.com</figcaption></figure><p>You can access the complete project here:<br>👉🏻 <a href="https://github.com/mertbekci">github.com/mertbekci</a></p><p>See you in new articles; you can check out my other writings here:<br> 👉🏻 <a href="https://mertbekci.com/">mertbekci.com</a></p><blockquote>If you have any specific sections you’d like further assistance with or need more detailed explanations, feel free to ask!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac24c6ae21ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MacOS’da Kullandığım Uygulamalar]]></title>
            <link>https://mertbekci.medium.com/macosda-kulland%C4%B1%C4%9F%C4%B1m-uygulamalar-88b6c68f6035?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/88b6c68f6035</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Tue, 31 Jan 2023 04:02:36 GMT</pubDate>
            <atom:updated>2023-01-31T04:02:36.254Z</atom:updated>
            <content:encoded><![CDATA[<p>MacOS kullanırken işimi kolaylaştıran, olmazsa olmaz dediğim uygulamalarımdan bir kısmını sizlerle paylaşıyorum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4xFyhVV4DUvIaGV1" /><figcaption>Photo by <a href="https://unsplash.com/@alesnesetril?utm_source=medium&amp;utm_medium=referral">Ales Nesetril</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Blog yazmak alışık olmadığınızda gerçekten çok zor, biraz beyni ve elleri bu yönde çalıştırmak için kolay bir şeyler yazarak başlayalım<em>👇</em></blockquote><blockquote>Birazdan sizlerle paylaşacağım uygulamaların hepsini gün içerisinde aktif olarak kullanmaktayım, bir şans verin derim <em>🙌</em></blockquote><p><a href="https://sparkmailapp.com/"><strong>Spark App</strong></a><strong> </strong>: Yıllardır tüm cihazlarımda kullandığım tek mail client. Android, iOS, MacOS desteği vardı, yakın zamanda Windows desteğini de getirdiler, ücretli/ücretsiz versiyonları var.</p><figure><img alt="sparkapp mail client" src="https://cdn-images-1.medium.com/max/1024/1*4B-vYTd4L9ELQ1Dqg2kX2A.png" /></figure><p><a href="https://maccy.app/"><strong>Maccy.app</strong></a> : Clipboard manager uygulaması, alternatifleri ücretli ve ücretsiz olarak çok fazla var ama open source olmasını ve sadeliğini ben çok sevdim.</p><figure><img alt="maccy clipboard manager" src="https://cdn-images-1.medium.com/max/1024/1*iP9PxD_ijrYSrHaj0MxPLg.png" /></figure><p><a href="https://www.alfredapp.com/"><strong>Alfred App</strong></a><strong> : </strong>MacOS’da bulunan spotlight alternatifi bir uygulama, spotlight’a göre çok daha performanslı ve detaylı arama yapmayı sağlıyor. Ekstra bir çok özelliği de var hatta yakın zamanda <a href="https://www.raycast.com/">Raycast</a> adında bir rakibi daha olduğunu öğrendim isterseniz göz atabilirsiniz.</p><figure><img alt="alftred app" src="https://cdn-images-1.medium.com/max/1024/1*pyHULCL26edNAqOhurwiHw.png" /></figure><p><a href="https://github.com/MonitorControl/MonitorControl"><strong>MonitorControl</strong></a> : Open source olarak kullandığım diğer bir uygulamada, dahili/harici tüm monitörlerin parlaklıklarını tek bir panel üzerinden çok pratik bir şekilde ayarlayabilirsiniz.</p><figure><img alt="monitor control" src="https://cdn-images-1.medium.com/max/1024/1*DZdQzG4B3sJViXfsGlTCkg.png" /></figure><p><a href="https://disk.yandex.com.tr/"><strong>Yandex Disk</strong></a> : Adını görür görmez anlayacaksınız ama okumadan geçmeyin, çünkü Yandex Disk uygulaması içerisinde ekran görüntüsü aracı ile geliyor ve içerisinde güzel özellikleri var. 👍 <br><em>Bu yazımdaki bütün ekran görüntülerini bu aracı kullanarak aldım.</em> 😁</p><figure><img alt="yandex disk" src="https://cdn-images-1.medium.com/max/1024/1*2N90yRN-w2qWuvb0hOYU-A.png" /></figure><p>Bir şeyleri yazmaya elimi alıştırmak için çok da teknik olmadan kullandığım uygulamaları dilim döndüğünce açıklamaya çalıştım, umarım sonuna kadar okumuşsunuzdur 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88b6c68f6035" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kararımı verdim!]]></title>
            <link>https://mertbekci.medium.com/karar%C4%B1m%C4%B1-verdim-8aee66ac20c2?source=rss-7f9382fa1e37------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aee66ac20c2</guid>
            <dc:creator><![CDATA[Mert Bekci]]></dc:creator>
            <pubDate>Sat, 07 Jan 2023 15:28:48 GMT</pubDate>
            <atom:updated>2023-01-07T16:06:45.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U9QW2iXImJTKQGS6" /><figcaption>Photo by <a href="https://unsplash.com/@foxxmd?utm_source=medium&amp;utm_medium=referral">Matt Duncan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>07.01.2023 tarihinde, 2017 yılında yazılmış bir makale okuyarak aydınlanma yaşadığım gün, evet kararımı verdiğim gün işte o gün!</p><p>Kahvemi yudumlayarak maillerimi kontrol ettiğim bir cumartesi günü okuduğum bloglardan bir tanesinin tam 5 yıl önce yazılmış olması bana her zaman kullandığım şu ata sözünü tekrar hatırlattı “<strong><em>Söz uçar yazı kalır” </em></strong>ve kararımı verdim! Artık blog yazmaya başlamalıyım!</p><p>Elimden geldiğince her zaman bir şeyleri bir yerlere not alan biri oldum hatta geçenlerde bir arkadaşımdan su cümleyi duydum <em>“Sen onu kesin bir yere yazmışsındır, kontrol et istersen” v</em>e evet haklı çıktı 😇</p><p>Peki bir şeyler yazmayı, çizmeyi bu kadar çok seven biri olarak neden hiç blog yazmadığımı hep sorgulamışımdır. Çok kez de denemişimdir. Paylaşıp silmişimdir. 2023 hedeflerim arasına bir yenisi daha geldi. Artık her ay en az bir adet blog post yazmaya çalışacağım ve zinciri kırmadan devam edeceğim.</p><p><strong>Peki ne hakkında yazacağım? 🤔</strong></p><p>Yazdığım ama paylaşmadığım bir çok teknik sorun ile ilgili notlarım var ama sadece teknik bir şeyler yazmak istemiyorum. Hatta bu konuda bana yardımcı olmak isterseniz veya herhangi bir sorunuz olduğunda benimle <a href="https://usebiolink.com/m">buradan</a> iletişime geçebilirsiniz.</p><p>Her 👏 bir destek unutmayın, hoşçakalın 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aee66ac20c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>