tblog_duopack 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_duopack.rb +17 -63
- 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: bc9763e2439e0dc25023dce673e8245f808f988728ef392ec557ca3ffbca9e9f
|
4
|
+
data.tar.gz: 60d5cc3b58cdd408bb783e6037f58f53cb4edd2bc32e22d53c6456aa95d790e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65b5b52e4b3b78f3c2408e27d34b0b61b1b5cb64534779f72240b8fdad546cba12334bae29130d02093527201f776a4659e3b9fe93b6080bc20ed1d1cbc410ab
|
7
|
+
data.tar.gz: f0f6db151b130e4d765b4f54716a0970db7a4edc5e2d976c0b3001f1e4fd122e9321e3c971dd4893f9443b4b392186743e3fb62d9f8801089da0585fed9cf9ad
|
data/lib/tblog_duopack.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'glimmer-dsl-libui'
|
2
2
|
require 'selenium-webdriver'
|
3
|
-
require 'webdrivers'
|
3
|
+
# require 'webdrivers'
|
4
4
|
require 'iconv'
|
5
5
|
require 'nokogiri'
|
6
6
|
require 'http'
|
@@ -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")
|
@@ -1522,19 +1502,10 @@ class Wordpress
|
|
1522
1502
|
|
1523
1503
|
def get_naver_text(q)
|
1524
1504
|
begin
|
1525
|
-
|
1526
|
-
|
1527
|
-
capabilities = [options]
|
1528
|
-
|
1529
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1530
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1505
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1506
|
+
@driver = Selenium::WebDriver.for :chrome
|
1531
1507
|
rescue
|
1532
|
-
|
1533
|
-
# :capabilities에 options를 배열로 전달
|
1534
|
-
capabilities = [options]
|
1535
|
-
|
1536
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1537
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1508
|
+
@driver = Selenium::WebDriver.for :chrome
|
1538
1509
|
end
|
1539
1510
|
@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')
|
1540
1511
|
noko = Nokogiri::HTML(@driver.page_source)
|
@@ -1564,19 +1535,10 @@ class Wordpress
|
|
1564
1535
|
|
1565
1536
|
def get_naver_text2(keyword)
|
1566
1537
|
begin
|
1567
|
-
|
1568
|
-
|
1569
|
-
capabilities = [options]
|
1570
|
-
|
1571
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1572
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1538
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1539
|
+
@driver = Selenium::WebDriver.for :chrome
|
1573
1540
|
rescue
|
1574
|
-
|
1575
|
-
# :capabilities에 options를 배열로 전달
|
1576
|
-
capabilities = [options]
|
1577
|
-
|
1578
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1579
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1541
|
+
@driver = Selenium::WebDriver.for :chrome
|
1580
1542
|
end
|
1581
1543
|
@driver.get('https://search.naver.com/search.naver?ssc=tab.blog.all&sm=tab_jum&query='+keyword.to_s)
|
1582
1544
|
for n3 in 1..10
|
@@ -1619,18 +1581,10 @@ class Wordpress
|
|
1619
1581
|
@user_pw = user_pw
|
1620
1582
|
@captcha_api_key = captcha_api_key
|
1621
1583
|
begin
|
1622
|
-
|
1623
|
-
|
1624
|
-
capabilities = [options]
|
1625
|
-
|
1626
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1627
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1584
|
+
Selenium::WebDriver::Chrome::Service.driver_path = './chromedriver.exe'
|
1585
|
+
@driver = Selenium::WebDriver.for :chrome
|
1628
1586
|
rescue
|
1629
|
-
|
1630
|
-
capabilities = [options]
|
1631
|
-
|
1632
|
-
# Selenium WebDriver에서 options를 capabilities로 전달
|
1633
|
-
@driver = Selenium::WebDriver.for(:chrome, capabilities: capabilities)
|
1587
|
+
@driver = Selenium::WebDriver.for :chrome
|
1634
1588
|
end
|
1635
1589
|
end
|
1636
1590
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tblog_duopack
|
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
|