tblog_zon 0.0.10 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tblog_zon.rb +16 -62
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a85cc0195395a28b0b56cad3690093b5831b312a36abce95b9f9e9327c8cde37
|
4
|
+
data.tar.gz: d27028ce9783c8ef8696012c0b9cfcc277a7a92b9038f1b6344c7a2e99a1da19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 622a4ab70ac84c5d9f9593f4441e276266a28761a30ed6b35b183f92534d49cc7b86944b7588e004cf4e039e9d7a77dd56692aa20bb40a849ff705374fa4da89
|
7
|
+
data.tar.gz: 6493c521ac8c5025f6f51b93f5f250cd191edbfde1c39929e8b6699ad83991c620a2df69527abea5bf4f61f934139df7de81c73f94b45747a8fabcef067cba34
|
data/lib/tblog_zon.rb
CHANGED
@@ -211,23 +211,8 @@ class Naver
|
|
211
211
|
end
|
212
212
|
|
213
213
|
def chrome_start(proxy)
|
214
|
-
chromedriver_path = './chromedriver.exe'
|
215
|
-
|
216
|
-
# 웹드라이버 자동 업데이트 시도
|
217
|
-
begin
|
218
|
-
# webdrivers가 사용자의 Chrome 버전에 맞는 chromedriver 다운로드 시도
|
219
|
-
Webdrivers::Chromedriver.update # 자동 업데이트 시도
|
220
|
-
rescue => e
|
221
|
-
puts "webdrivers에서 chromedriver 다운로드 실패: #{e.message}"
|
222
|
-
puts "자동으로 chromedriver.exe 사용합니다."
|
223
|
-
puts "만일 프로그램 폴더안에 chromedriver.exe 버전이 맞지 않거나 없는 경우 인터넷창이 깜빡하고 닫히거나 열리지 않는경우에만 아래 안내를 따라주세요."
|
224
|
-
puts "https://storage.googleapis.com/chrome-for-testing-public/사용자크롬버전/win32/chromedriver-win32.zip 링크를 복사 후 복사 된 링크 중(사용자크롬버전) 부분을 크롬 사용자의 버전(예:131.0.6778.264)으로 수정 후 주소입력 부분에 넣어 엔터 후 다운로드 하고 압축을 풀고 chromedriver.exe 파일만 프로그램 폴더안에 넣어주세요."
|
225
|
-
puts "인터넷 창이 열리고 작업을 한다면 위 항목은 패스해주세요."
|
226
|
-
# 예외가 발생하면 수동 경로 사용
|
227
|
-
Selenium::WebDriver::Chrome::Service.driver_path = chromedriver_path
|
228
|
-
end
|
229
214
|
# 공통 옵션 설정
|
230
|
-
|
215
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
231
216
|
options = Selenium::WebDriver::Chrome::Options.new
|
232
217
|
|
233
218
|
options.add_extension('./crx/app.crx') # 확장 프로그램을 첫 번째 탭에 추가
|
@@ -264,12 +249,11 @@ class Naver
|
|
264
249
|
|
265
250
|
# 브라우저 실행
|
266
251
|
begin
|
267
|
-
#
|
268
|
-
|
269
|
-
|
270
|
-
#
|
271
|
-
|
272
|
-
|
252
|
+
# 새 드라이버 실행
|
253
|
+
@driver = Selenium::WebDriver.for(:chrome, options: options)
|
254
|
+
|
255
|
+
# 첫 번째 탭에서 확장 프로그램을 로드
|
256
|
+
#@driver.get("chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html")
|
273
257
|
|
274
258
|
sleep(1)
|
275
259
|
# 두 번째 탭에서 로그인 페이지 열기
|
@@ -280,11 +264,7 @@ class Naver
|
|
280
264
|
|
281
265
|
puts "Error: #{e.message}"
|
282
266
|
puts 'Using default Chrome driver without proxy'
|
283
|
-
|
284
|
-
capabilities = [options]
|
285
|
-
|
286
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
287
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
267
|
+
@driver = Selenium::WebDriver.for(:chrome, options: options)
|
288
268
|
|
289
269
|
# 첫 번째 탭에서 확장 프로그램을 로드
|
290
270
|
#@driver.get("chrome-extension://ifibfemgeogfhoebkmokieepdoobkbpo/options/options.html")
|
@@ -1483,19 +1463,10 @@ class Wordpress
|
|
1483
1463
|
|
1484
1464
|
def get_naver_text(q)
|
1485
1465
|
begin
|
1486
|
-
|
1487
|
-
|
1488
|
-
capabilities = [options]
|
1489
|
-
|
1490
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1491
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1466
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1467
|
+
@driver = Selenium::WebDriver.for :chrome
|
1492
1468
|
rescue
|
1493
|
-
|
1494
|
-
# :capabilities에 options를 배열로 전달
|
1495
|
-
capabilities = [options]
|
1496
|
-
|
1497
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1498
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1469
|
+
@driver = Selenium::WebDriver.for :chrome
|
1499
1470
|
end
|
1500
1471
|
@driver.get('https://search.naver.com/search.naver?display=15&f=&filetype=0&page=3&query='+q.to_s+'&research_url=&sm=tab_pge&start=16&where=web')
|
1501
1472
|
noko = Nokogiri::HTML(@driver.page_source)
|
@@ -1525,19 +1496,10 @@ class Wordpress
|
|
1525
1496
|
|
1526
1497
|
def get_naver_text2(keyword)
|
1527
1498
|
begin
|
1528
|
-
|
1529
|
-
|
1530
|
-
capabilities = [options]
|
1531
|
-
|
1532
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1533
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1499
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1500
|
+
@driver = Selenium::WebDriver.for :chrome
|
1534
1501
|
rescue
|
1535
|
-
|
1536
|
-
# :capabilities에 options를 배열로 전달
|
1537
|
-
capabilities = [options]
|
1538
|
-
|
1539
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1540
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1502
|
+
@driver = Selenium::WebDriver.for :chrome
|
1541
1503
|
end
|
1542
1504
|
@driver.get('https://search.naver.com/search.naver?ssc=tab.blog.all&sm=tab_jum&query='+keyword.to_s)
|
1543
1505
|
for n3 in 1..10
|
@@ -1580,18 +1542,10 @@ class Wordpress
|
|
1580
1542
|
@user_pw = user_pw
|
1581
1543
|
@captcha_api_key = captcha_api_key
|
1582
1544
|
begin
|
1583
|
-
|
1584
|
-
|
1585
|
-
capabilities = [options]
|
1586
|
-
|
1587
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1588
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1545
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1546
|
+
@driver = Selenium::WebDriver.for :chrome
|
1589
1547
|
rescue
|
1590
|
-
|
1591
|
-
capabilities = [options]
|
1592
|
-
|
1593
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1594
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1548
|
+
@driver = Selenium::WebDriver.for :chrome
|
1595
1549
|
end
|
1596
1550
|
end
|
1597
1551
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tblog_zon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: File to Clipboard gem
|
14
14
|
email: mymin26@naver.com
|