Comments (4)
目前為了文章推文即時性,並沒有從網頁抓文章喔@@ 都是直接登入 PTT 解析的。
from pyptt.
我並不是希望從網頁上抓文章,而是希望有選項把「自動斷行的文字」接回(?)一行。
from pyptt.
那怎麼知道...那是自動斷行?
from pyptt.
我不太確定 PTTLibrary 是怎麼爬的,所以列出大概可行的方案,這篇為例︰
文章代碼(AID): #1R9_jKGC (Test) [ptt.cc] [測試] 123456789012345678901234
文章網址: https://www.ptt.cc/bbs/Test/M.1529346900.A.40C.html
-
按小 j 一行一行爬。假如畫面上的第一行被自動斷行,按下 j 會一次跳過兩行以上。
-
顯示斷行符號,輸入
om
,然後檢查行尾是否是斷行符號
缺點︰- 如果遇到假的斷行符號(自行在行尾加一個亮白色的
\
),會判斷錯誤 - 如果某行長到佔滿一整面,按小 j 會直接跳過一整頁,看不到行尾。
- 如果遇到假的斷行符號(自行在行尾加一個亮白色的
-
- 偵測到截行符號時,輸入
>
將畫面往右移,取得被截的文字。 - 整行都取得後(偵測不到截行符號後),輸入對應數量的
<
移回原位。 - 優點︰
- 沒有前述方法的缺點
- 即使有假的截行符號,也會在右移後發現該符號是假的,為使用者文章的一部份。
- 偵測到截行符號時,輸入
from pyptt.
Related Issues (20)
- 新手問題(AttributeError: module 'PyPtt' has no attribute 'API') HOT 1
- 板主名單有特殊字元出錯 HOT 2
- 請問有辦法取得一定範圍的文章嗎? HOT 4
- 使用get_newest_index取book看板的newest_index不是最新的 HOT 3
- 抓取指定 user 名稱文章 HOT 2
- get_newest_index 用 search_list 搜特定關鍵字異常 HOT 7
- Dhggy
- SingleLog 是否為必須的依賴? HOT 3
- 在抓我的最愛的時候,碰到分隔線就不繼續往下抓看板了 HOT 1
- 使用 PyPtt 的各位,有沒有意願加入 AI Labs
- 功能新增:匿名發文功能 HOT 8
- ConnectError: 連線失敗 HOT 3
- Failed to connect to PTT while PTT2 is Good HOT 1
- 編輯紅包袋 HOT 3
- code execution backdoor
- get_mail function will raise exception when mail without proper title HOT 3
- get_newest_index回傳2,但只有一篇文章(aid相同) HOT 1
- 新增功能;樂透功能 HOT 3
- comment 功能異常 HOT 1
- comment 功能異常 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyptt.