大家经常会有隐身模式刷offer的需求,比如这个
所以我(通过某些大家都知道的工具)写了一个脚本来开隐身模式刷offer。他每5秒钟开一个chrome incognito window打开这个页面,match到对应的字符串就停在这个页面(别忘了20分钟自动失效),否则关闭并重新打开。
我跑了一会,反正我本地是出不来250K的offer。也许真的得像贴子里说的得等20分钟点刷新才行。不过我手动试了两天也出不来。
希望有缘人去试着跑跑吧,let us know if it works。
用来刷别的offer也可以,以前用类似的脚本刷过chase黑车的promo code,等大家开发别的玩法。(绕过Chase 5/24政策的特殊申请链接【奇技淫巧】【已过期】【密码是“苟”开头的那句诗(7个字 小写拼音)】 - 美国信用卡指南 )
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
import time
def check_string_in_webpage(url, string_to_check):
# Set up Chrome options for incognito mode
chrome_options = Options()
chrome_options.add_argument("--incognito")
# Setup the webdriver with incognito mode
driver = webdriver.Chrome(options=chrome_options)
while True:
# Open the webpage
driver.get(url)
# Wait for the page to load (adjust the sleep time as needed)
time.sleep(5)
# Check if the specific string is in the page
if string_to_check in driver.page_source:
print(f"String '{string_to_check}' found in the webpage.")
break
else:
print(f"String '{string_to_check}' not found. Reopening the webpage...")
# Close the current tab and reopen
driver.quit()
driver = webdriver.Chrome(options=chrome_options)
input("Press any key to exit...")
# Close the browser
driver.quit()
# Example usage
url = "https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-platinum-credit-card-amex/"
string_to_check = "250,000 Membership"
check_string_in_webpage(url, string_to_check)
3/28/2024 Update: 下面这个版本可以等20分钟然后点刷新了,更符合原贴子里的dp。现在的效果是,如果没找到,就一直等,直到有刷新按钮,就点刷新。如果找到了,直接点Apply,就跳到下一个申请页面不会20分钟过期了,那个页面上也会显示你的offer是啥,确认250k以后再申请。
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
import time
import os
def play_sound():
# Play the default system sound on macOS
os.system('afplay /System/Library/Sounds/Submarine.aiff')
def check_string_in_webpage(url, string_to_check):
chrome_options = Options()
chrome_options.add_argument("--incognito")
driver = webdriver.Chrome(options=chrome_options)
# Open the webpage
driver.get(url)
ct = 1
while True:
time.sleep(3)
try:
# close the popup asking for 4 million
svg_element = driver.find_element(By.XPATH, "//svg[@data-src='https://icm.aexp-static.com/Internet/Acquisition/US_en/AppContent/OneSite/Data/SVG/dls/dls-icon-close.svg']")
svg_element.click()
except NoSuchElementException:
pass
try:
if string_to_check in driver.page_source:
try:
print(f"String '{string_to_check}' found in the webpage. ct: {ct}")
play_sound()
button = driver.find_element(By.XPATH, "//button[@title='Click here to apply for Business Platinum Card from American Express']")
button.click()
break
except NoSuchElementException:
print("Success path: Button not found on the page. Will try again...")
else:
print(f"String '{string_to_check}' not found. Attempting to click 'Refresh' button... ct: {ct}")
try:
refresh_button = driver.find_element(By.XPATH, "//button[text()='Refresh']")
refresh_button.click()
ct += 1
print("Fail path: Clicked Refresh button to refresh page. ct: {ct}")
except NoSuchElementException:
print("Fail path: Button not found on the page. Will try again...")
# Wait for 60 seconds before the next iteration
time.sleep(5)
except NoSuchElementException:
print("Error occurred. Trying again...")
time.sleep(5)
input(f"Press any key to exit... ct: {ct}")
# Close the browser
driver.quit()
url = "https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-platinum-credit-card-amex/"
string_to_check = "250,000 Membership"
check_string_in_webpage(url, string_to_check)