Mar-22-2020, 09:19 AM
(Mar-22-2020, 09:04 AM)ndc85430 Wrote: I'm confused. You wrote a function that you don't understand? It looks like you have the data in the variablesallOpinion
,allTitle
andallURL
, so why can't you call your function, passing in the values?
ndc85430,
I modified an existing reference function and since the bottom two lines look as if when the function is being called it's manual entered data.
When parsing the HTML to CSV as I have above this segment of code; I used the same variables. I don't know how to call the function with each of those variables.
Would I go about something like this:
CSV variables for Parse HTML Cycle #1:
allOpinion[0]
allTitle[0]
allURL
Reference Code Calling the Function w/ Custom Data:
insertVariblesIntoTable(2, 'Area 51M', 6999, '2019-04-14') insertVariblesIntoTable(3, 'MacBook Pro', 2499, '2019-06-20')Attempt #1 at Calling the Function w/ Parse HTML Cycle #1 Variables that CSV uses:
insertVariablesIntoTable('allTitle[0]', 'allOpinion[0]', 'allURL')Adding the above code as the bottom line in my .py I receive the following error:
Quote:Traceback (most recent call last):
File "HTML2CSV-NoWrite3Variables-to-MySQL.Python.Variable.Passoff.MySQL.INSERT.py", line 61, in <module>
insertVariablesIntoTable('allTitle[0]', 'allOpinion[0]', 'allURL')
NameError: name 'insertVariablesIntoTable' is not defined
Do you have any suggestions as to how to remedy this?
“And one of the elders saith unto me, Weep not: behold, the Lion of the tribe of Juda, the Root of David, hath prevailed to open the book,...” - Revelation 5:5 (KJV)
“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)
#LetHISPeopleGo
“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)
#LetHISPeopleGo