-3

i wrote in python small code, how to take in sequence line from nicknames.txt and add to webpath like first line is "joe" -> www.example.com/joe

import requests,os
from selenium import webdriver
from time import sleep
driver = webdriver.Firefox(executable_path= r'geckodriver.exe')

    class Checker:
      def Nicknames():
          text = open('nicknames.txt').read()
    
      def __init__(self):
          self.driver = webdriver.Firefox()
          self.driver.get("https://pl.namemc.com/" + 'text')
          sleep(3)
    
    
          name = driver.find_element_by_xpath("/html/body/main/h1")
          cape = driver.find_element_by_xpath("/html/body/main/div/div[2]/div[4]/div[1]")
          print('name', " | ", 'cape')
    
    Checker()

1 Answers1

-1

You can use the answer here to find the file name of your retried file (I dont know your os or what you mean by 'text'), and once you have that you can concatenate it with your path.

Carlos Medina
  • 380
  • 2
  • 15